goon/app/api
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
..
__init__.py Initial commit 2026-05-20 10:10:22 +02:00
admin.py Initial commit 2026-05-20 10:10:22 +02:00
admin_html.py Initial commit 2026-05-20 10:10:22 +02:00
blacklist.py Initial commit 2026-05-20 10:10:22 +02:00
bug_reports.py Initial commit 2026-05-20 10:10:22 +02:00
expo_updates.py session work: bug-report fixes + WIP cleanup 2026-05-25 22:02:52 +02:00
favorites.py perf(taxonomy): denormalize scene_count for tags/performers/studios 2026-05-31 17:53:48 +02:00
movies.py feat(movies): watched/continue-watching tracking end-to-end 2026-05-28 23:24:06 +02:00
playback.py perf(movies+scenes): direct-play #hash movie hosters; skip empty blacklist filters 2026-06-06 19:44:41 +02:00
scene_favorites.py Initial commit 2026-05-20 10:10:22 +02:00
scenes.py perf(scenes): literal tag_id in filter — 4-12s tag lists -> ~20ms 2026-06-07 21:10:31 +02:00
schemas.py perf(scenes): bounded count + has_more for filtered scene lists 2026-05-31 19:24:26 +02:00
seo.py feat(seo): public HTML SEO router + templates; add CLAUDE.md; ignore .nimbalyst 2026-05-31 16:29:59 +02:00
sources.py session work: bug-report fixes + WIP cleanup 2026-05-25 22:02:52 +02:00
stream_proxy.py session work: bug-report fixes + WIP cleanup 2026-05-25 22:02:52 +02:00
taxonomies.py perf(taxonomy): denormalize scene_count for tags/performers/studios 2026-05-31 17:53:48 +02:00
watch.py feat(movies): watched/continue-watching tracking end-to-end 2026-05-28 23:24:06 +02:00