gendesign/backend/app/services
lekss361 144970aadd feat(analytics): mv_layout_velocity MV + refresh helper (#113 PR B)
Add materialized view aggregating objective_corpus_room_month JOIN
objective_complex_mapping (matched via objective_complex_name) за last
24 months, grouped by (domrf_obj_id, room_bucket). Cyrillic 'студия'
normalised к ASCII 'studio' для consistency с layout_signature.py (PR A).

Tables / cardinality (verified live на проде):
- objective_corpus_room_month: 15 738 EKB rows, monthly 2025-05..2026-05
- objective_complex_mapping: 114 mapped EKB objects (7.5% coverage)
- Expected MV size: ~459 rows (114 objs × ~4 room_buckets)
- EXPLAIN: Hash Join 19k×114 → 8k pre-agg → 459 groups, no extra indexes needed

UNIQUE INDEX (obj_id, room_bucket) enables REFRESH CONCURRENTLY (used
by Python helper layout_velocity_refresh.py — НЕ scheduled в этом PR,
будет triggered manually или через celery beat в follow-up).

Migration applied auto-через deploy.yml (see .claude/rules/sql.md).

Smoke verification — qa-tester after deploy (test_layout_velocity_mv.py
removed because conftest.py / db fixture infra не существует в проекте;
проще smoke через прод SELECT COUNT после migration apply).
2026-05-16 11:00:02 +03:00
..
cadastre perf(cadastre): freshness skip + grid-walk heartbeat + log noise reduction (#187) 2026-05-15 23:02:37 +03:00
exporters init 2026-04-25 13:45:19 +03:00
generative deploy.yml: sync compose+Caddyfile from git, reload caddy after up 2026-04-26 13:31:26 +03:00
photos fix ui lag 2026-04-27 20:26:55 +03:00
scrapers feat(scrapers): search_by_quarter orchestrator + QuarterDump (#94 pt.2/4) (#109) 2026-05-12 18:11:30 +03:00
site_finder feat(analytics): mv_layout_velocity MV + refresh helper (#113 PR B) 2026-05-16 11:00:02 +03:00
__init__.py init 2026-04-25 13:45:19 +03:00
analytics_queries.py feat(velocity): migrate D2 sales source → objective_corpus_room_month (#158) 2026-05-15 09:34:00 +03:00
analytics_refresh.py fix(scrape): SQLAlchemy text() парсил ':00:' regex как named-param 2026-04-30 23:16:11 +03:00
job_settings.py fix(cadastre,nspd_sync): SQL syntax bugs surfaced by ekb_full v2 (#186) 2026-05-15 19:18:43 +03:00
objective_etl.py fix(worker): port objective_etl from psycopg2 → psycopg v3 2026-05-11 12:07:57 +03:00
objective_sync_config.py feat(objective): full sync pipeline + dynamic admin config 2026-05-10 19:54:15 +03:00