goon/app
jtrzupek 2163fee245 perf(taxonomy): denormalize scene_count for tags/performers/studios
Counts for /tags, /performers, /studios and /favorites were computed live
per-request by aggregating scene_tags / scene_performers with an EXISTS to
playback_sources. As the catalog grew to ~1.7M scenes (6.3M scene_tags) this
ran ~4.3s for /tags?order=popular (x2 incl. the total count) and ~950ms for
the default /scenes count, making those screens load in several seconds.

- migration 0019: add scene_count (+ DESC index) to tags/performers/studios
- background job _job_refresh_taxonomy_counts (every 3h) recomputes the counts
  in one UPDATE..FROM each (IS DISTINCT FROM to skip unchanged rows)
- /tags, /performers, /studios scenes path now read the column + ORDER BY the
  indexed scene_count; for_movies paths keep live aggregation (small tables)
- favorites read denormalized scene_count instead of a grouped EXISTS aggregate
- /scenes default count: 10-min in-process TTL cache (header is approximate)

Measured: /tags?order=popular&per_page=500 ~8s -> 66ms incl. serialization.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 17:53:48 +02:00
..
api perf(taxonomy): denormalize scene_count for tags/performers/studios 2026-05-31 17:53:48 +02:00
connectors fix(scheduler): per-connector hard timeout + reorder mangoporn-first 2026-05-31 11:19:13 +02:00
extractors fix(extractor/yespornvip): switch to WebView fallback - both URL paths fail 2026-05-30 12:28:17 +02:00
models perf(taxonomy): denormalize scene_count for tags/performers/studios 2026-05-31 17:53:48 +02:00
normalize Initial commit 2026-05-20 10:10:22 +02:00
resolve fix(scenes): use ON CONFLICT for tag slug upsert in enrich_tags_from_tube 2026-05-27 15:38:43 +02:00
scheduler perf(taxonomy): denormalize scene_count for tags/performers/studios 2026-05-31 17:53:48 +02:00
templates feat(seo): public HTML SEO router + templates; add CLAUDE.md; ignore .nimbalyst 2026-05-31 16:29:59 +02:00
__init__.py Initial commit 2026-05-20 10:10:22 +02:00
auth.py Initial commit 2026-05-20 10:10:22 +02:00
config.py perf(taxonomy): denormalize scene_count for tags/performers/studios 2026-05-31 17:53:48 +02:00
db.py Initial commit 2026-05-20 10:10:22 +02:00
ingest.py Initial commit 2026-05-20 10:10:22 +02:00
main.py fix(apk 0.2.1): in-app installer "nic się nie dzieje" + oo launcher icon 2026-05-31 13:15:37 +02:00