logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

[OSM-dev] getnodes index?: msg#00052

Subject: [OSM-dev] getnodes index?
I'm porting the getnodes query to Python for my planet stuff, and I was
having the SQL queries take *much* longer than I expected. I then did an
explain on the query, and it said that it wasn't using the
longitude/latitude key when doing a query. Adding seperate indices for
lat/lon made the query move from 7 minutes (for a .01 x .01 degree area)
to less than 1sec. 

I'm assuming that this isn't the case on the main OSM server, but for
me:

alter table nodes add index nodes_lon_idx (longitude);
alter table nodes add index nodes_lat_idx (latitude);

Makes everything a lot faster. You might want to try this if you've got
a local version of the OSM db.

-- 
Christopher Schmidt
Web Developer


<Prev in Thread] Current Thread [Next in Thread>