Skip to content

feat(etl): port tag_track_user MV and add to refresher (parity 4B)#248

Open
raymondjacobson wants to merge 1 commit intoetl/parity-4a-publish-scheduledfrom
etl/parity-4b-mv-refresh
Open

feat(etl): port tag_track_user MV and add to refresher (parity 4B)#248
raymondjacobson wants to merge 1 commit intoetl/parity-4a-publish-scheduledfrom
etl/parity-4b-mv-refresh

Conversation

@raymondjacobson
Copy link
Copy Markdown
Contributor

Summary

Stack 4B. apps' `tag_track_user` materialized view explodes `tracks.tags` into one row per `(tag, track_id, owner_id)` and is used for tag-search queries. It only depends on the `tracks` table which we already have.

  • Migration 0023 ports the MV definition verbatim from apps' schema (lowercase + comma-split + filter-non-deleted-public-stems) plus indexes on `tag` and `track_id`.
  • materialized_view_refresher.go adds it to the periodic refresh list alongside the two existing dashboard views.

Other MVs deferred

Other apps MVs depend on tables not yet in go-openaudio:

  • `aggregate_interval_plays` → `plays` (apps schema; we have `etl_plays` only)
  • `app_name_metrics_*` → `aggregate_daily_app_name_metrics`
  • `route_metrics_*` → `route_metrics`

These land if/when their underlying tables do. Calling them out in the commit so they're not lost.

Stack context

Stacked on #247 (4A — scheduled releases).

Test plan

  • Migration applies cleanly on fresh DB.
  • `REFRESH MATERIALIZED VIEW tag_track_user` succeeds.
  • `go build ./...` clean.

🤖 Generated with Claude Code

…parity 4B)

Stack 4B. apps' tag_track_user MV explodes tracks.tags into one row per
(tag, track_id, owner_id) and is used for tag-search queries. It only
depends on the tracks table which we already have.

- Migration 0023 ports the MV definition verbatim from apps' schema
  including the lowercase + comma-split + filter-non-deleted-public-stems
  logic, plus indexes on tag and track_id.
- materialized_view_refresher.go adds it to the periodic refresh list
  alongside the two existing dashboard views.

Other apps MVs (aggregate_interval_plays, app_name_metrics_*,
route_metrics_*) depend on tables not yet in go-openaudio (plays,
aggregate_daily_app_name_metrics, route_metrics) — those land if/when
their underlying tables do.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant