perf(martin+postgres): connection pool limit + compound indexes + minzoom alignment
- Martin: pool_size=8 (prevents overwhelming PostgreSQL with concurrent queries) - Martin: gis_terenuri minzoom 10→14, gis_cladiri minzoom 12→15 (PMTiles serves z0-z14, no point in Martin generating those) - PostGIS: add compound index layerId+geom for Martin view queries - PostGIS: add B-tree index on layerId for LIKE filtering in views Fixes 90% CPU on PostgreSQL during cold tile loads at detail zoom levels. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,14 @@ WHERE geometry IS NOT NULL AND geom IS NULL;
|
||||
CREATE INDEX IF NOT EXISTS gis_feature_geom_idx
|
||||
ON "GisFeature" USING GIST (geom);
|
||||
|
||||
-- Compound index: layerId + spatial — Martin queries filter by layer via views
|
||||
CREATE INDEX IF NOT EXISTS gis_feature_layer_geom_idx
|
||||
ON "GisFeature" ("layerId", geom) WHERE geom IS NOT NULL;
|
||||
|
||||
-- B-tree index on layerId for view filtering (LIKE 'TERENURI%', 'CLADIRI%')
|
||||
CREATE INDEX IF NOT EXISTS gis_feature_layer_id_idx
|
||||
ON "GisFeature" ("layerId");
|
||||
|
||||
-- =============================================================================
|
||||
-- 7. QGIS-friendly views
|
||||
-- - Clean snake_case column names
|
||||
|
||||
Reference in New Issue
Block a user