perf(tradein): GIST index on (geom::geography) for estimator radius filter (#1189) #1924
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1924
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "perf/1189-listings-geom-geography-gist"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#1189 — EXPLAIN-решение об индексе (measured, not blind)
Estimator analog query (Tier W/H/S radius) uses
ST_DWithin(geom::geography, point, radius), butlistings_geom_idxisgist(geom)(geometry). The geography cast prevents the planner from using it spatially →ST_DWithinfalls to a Filter, and the geom index runs onlygeom IS NOT NULL(scans 54.5k rows).Prod EXPLAIN (2026-06-26, ЕКБ point r=1500, 2-room 45-65m²):
BitmapAnd(geom IS NOT NULL=54531) + Filter ST_DWithin→ 180ms, read 3961 buffers.Index Scan ... (geom::geography) && _st_expand(point,1500)→ ~38ms (~4.7×), ~5k rows touched.Measured by dry-run on real prod (
BEGIN; CREATE INDEX; EXPLAIN ANALYZE; ROLLBACK) — not blind (per #1189's "не создавать индекс вслепую").Migration 134
CREATE INDEX IF NOT EXISTS listings_geom_geog_idx ON listings USING gist ((geom::geography)).IF NOT EXISTS), non-destructive — no data touched.geom::geography, soST_DWithinstarts using the index as Index Cond automatically.listings_geom_idx(gist(geom)) kept for geometry-space paths.Refs #1189