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). |
||
|---|---|---|
| .. | ||
| api | ||
| core | ||
| models | ||
| schemas | ||
| scrapers | ||
| services | ||
| workers | ||
| __init__.py | ||
| main.py | ||