Jochen Topf <jochen <at> remote.org> writes:

> 
> Much too slow. Requiring joins on every query is not a good idea. And having
> the right indexes is important. You can't just index everything and hope it
> would do the right thing. (The most important index btw is the geometry index
> not the attribute indexes, although having the right attribute indexes here
> or there can help.)
 
I sent by followup accidentally to osm-dev list. The main message was that
perhaps there is a need to do some tests before saying if hstore or joined
tables are faster.

Here is a Spatialite database for testing

http://latuviitta.org/documents/relation_test.zip

First trials suggest that joined tables with proper indexes are not at all
slow and compared with the standard tables created by osm2pgsql the query
times can be several times faster. This is not a fair comparison because
osm2pgsql tables are missing the attribute indexes but so they normally do
in the Mapnik chain. Query times vary, so try yourself. Data is osm_lines
from Berlin from some months ago.

By the way, recent development around GDAL suggests that Spatialite may be
faster with spatial and attribute queries than PostGIS. Improvements in GDAL
Spatialite driver made Mapserver about 20 times faster than it used to be and
now Spatialite is faster that PostGIS and even shapefiles.


query from osm_line from osm2pgsql
=======================
select geometry, highway from osm_line
where highway='primary'
0.531 seconds

query from joined tables
===============================
select * from line_geometry, tags
where tags.tag='highway' and tags.value='primary'
and tags.join_id=line_geometry.osm_id
0.059 seconds


-Jukka Rahkonen-


_______________________________________________
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk

Reply via email to