GeoKnow / LinkedGeoData

OpenStreetMap for the Semantic Web
http://linkedgeodata.org
GNU General Public License v3.0
133 stars 32 forks source link

Performance issue on lgd_way_tags_resource_k #17

Closed Aklakan closed 9 years ago

Aklakan commented 9 years ago

The following query on with lgd_node_tags_resource_k works as expected, but on way tags the query plan goes wrong. Either the view definition could be optimized, or the magic constants in the postgresql config could be tweaked.

SELECT COUNT(*) "cnt" FROM ( SELECT true FROM "lgd_way_tags_resource_kv" a_250528 WHERE (a_250528."property" IS NOT NULL) AND (a_250528."object" IS NOT NULL) AND (a_250528."way_id" IS NOT NULL) AND (a_250528."object" = 'http://linkedgeodata.org/ontology/BuildingMonastery'::text) AND (a_250528."property" = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'::text) LIMIT 100 ) a;

Vaccuum full analyze did not help.

Aklakan commented 9 years ago

Fixed with 1a2700f123a361da29f3483180ead2535e30e319

The reason was, that the view for the nodes was already a different version that performed better. Switched the corresponding views for ways and relation to that style as well.