GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
What is the best way to optimize queries to Geonames database?  XML
Forum Index -> General
Author Message
Alexey



Joined: 19/08/2007 20:31:10
Messages: 24
Offline

Hello guys,

I've uploaded big geonames database to my server (MySQL). I wonder how can I get faster queries?

I have cheap server. It's Celeron 2.8 with 1 Gb of RAM. For example, this query takes 10 seconds:

SELECT * FROM geonamesbig WHERE latitude > '48.832633619561896' AND latitude < '48.90083790234088' AND longitude > '2.1649932861328125' AND longitude < '2.5014495849609375' ORDER BY 'population' DESC LIMIT 0, 20 


I need to get fast queries, like 0.1-0.5 seconds instead of 10 seconds. What is the best way to get fast queries:

1. Better, more expensive server. Will this solve the problem? Or it's not worth of the money?

2. Optimizing queries. Still I don't think this will give me 0.1 seconds query instead of 10 seconds. Am I wrong?

3. Splitting database to 500-5000 tables by coordinates (splitting map virtually to small quares). Is this a good idea?

Any help would be appreciated.
marc



Joined: 08/12/2005 07:39:47
Messages: 4499
Offline

Do you use any indices on your columns? You should also look at the geospatial features of mysql :
http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html

We at GeoNames are using Postgres/postgis.

Cheers

Marc

[WWW]
Alexey



Joined: 19/08/2007 20:31:10
Messages: 24
Offline

marc wrote:
Do you use any indices on your columns? You should also look at the geospatial features of mysql :
http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html

We at GeoNames are using Postgres/postgis.

Cheers

Marc 

Thanks Marc, I will defenetly read this.
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team