osm2pgsql now supports creating indexes within the flex config (lua) files. It's a good time to review the default indexes created, there are a few new ones I think will be worth adding. One example is osm.road_line currently has a partial index on major.
CREATE INDEX ix_osm_road_line_major
ON osm.road_line (major)
WHERE major;
I think having similar indexes on the route_foot, route_cycle, and route_motor columns makes sense.
Details
osm2pgsql now supports creating indexes within the flex config (lua) files. It's a good time to review the default indexes created, there are a few new ones I think will be worth adding. One example is
osm.road_line
currently has a partial index onmajor
.I think having similar indexes on the
route_foot
,route_cycle
, androute_motor
columns makes sense.References
Docs: https://osm2pgsql.org/doc/manual.html#defining-indexes
Changes: https://github.com/openstreetmap/osm2pgsql/pull/1847/files#diff-9e83c8554b4c314f902bae63cec9cf2dfbebb3efab69cf8ebd76b38cd843b4ef