SK53
(SK53)
2
The osm2pgsql tables are designed to be queried using bounding boxes, which is why they are indexed on the primary key and the geometry columns: I see no bounding boxes on your sample query plans.
In the absence of bounding boxes I would expect to see table scans. Adding indexes on the tag-based columns can certainly help performance, but penalises update times. In Postgres you can add indexes with conditions as well, which may well improve index selectivity for
Please provide more context: are these mapnik queries (they look like it to me), are these the complete queries, what data do you have loaded (country, rowcounts from planet_osm tables), what is the area that you are querying. Have you vacuumed all the tables? What platform & resources do you have available?