The comparables block on /analytics/recommend was showing the same ЖК multiple times (ЖК СТАРТ × 3, ЭХО ЛЕСА × 2 etc) because domrf_kn_objects has ~3 historical snapshots per obj_id. The previous query joined all rows and LIMIT 5 cherry-picked duplicates by flat_count. Fix: wrap base in CTE `latest_obj` with `DISTINCT ON (obj_id) ORDER BY obj_id, snapshot_date DESC` to pick only the latest snapshot per object before sorting by flat_count. |
||
|---|---|---|
| .. | ||
| exporters | ||
| generative | ||
| photos | ||
| scrapers | ||
| site_finder | ||
| __init__.py | ||
| analytics_queries.py | ||
| analytics_refresh.py | ||
| job_settings.py | ||
| objective_etl.py | ||
| objective_sync_config.py | ||