goon/app
jtrzupek 43f7e1f7b2 perf(scenes): literal tag_id in filter — 4-12s tag lists -> ~20ms
Tag-filtered scene lists (e.g. blowjob + has_playback) took 4-12s. Root cause:
the filter joined scene_tags->tags on slug, so the actual tag_id was opaque to
the planner at plan time. It fell back to average per-tag cardinality
(8.4M/11541 ≈ 726) instead of the real 273k, chose to materialize ALL matching
scene_tags + check playback per row, then top-N sort.

Fix: resolve slug->tag_id in the app and filter on a LITERAL tag_id (no slug
join). With a constant, the planner uses MCV stats, knows the tag is huge, and
walks ix_scenes_created_at_desc probing scene_tags/playback per scene, stopping
at the page limit. Verified: blowjob list 3300ms -> 18ms (EXPLAIN), HTTP 4-12s ->
47ms. Unknown slug short-circuits to empty. (Pairs with the raised tag_id
statistics target so mid-tier tags also get correct estimates.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 21:10:31 +02:00
..
api perf(scenes): literal tag_id in filter — 4-12s tag lists -> ~20ms 2026-06-07 21:10:31 +02:00
connectors refactor(ingest): rename scraper Source name "pornapp" -> "tube-scraper" 2026-06-07 16:54:55 +02:00
extractors fix(playback): mark deleted sxyprn posts dead + rank native sources first 2026-06-07 14:09:01 +02:00
models perf(taxonomy): denormalize scene_count for tags/performers/studios 2026-05-31 17:53:48 +02:00
normalize feat(ingest): SQL phash match, tag inference + backfill, clip-store skip, browse tubes, watchdog 2026-06-01 15:07:35 +02:00
resolve fix(tags): merge <base>2 numbered-duplicate tags + prevent regeneration 2026-06-06 23:18:44 +02:00
scheduler feat(dedup): merge exact-phash + same-duration + shared-performer duplicates 2026-06-07 20:08:06 +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 feat(ingest): skip <180s tube scenes (trailers) + purge porndoe trailer orphans 2026-06-03 10:11:25 +02:00
db.py Initial commit 2026-05-20 10:10:22 +02:00
ingest.py feat(ingest): skip <180s tube scenes (trailers) + purge porndoe trailer orphans 2026-06-03 10:11:25 +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