Skip to content

revert: property MV router (PRs #356/#358/#359) pending v2 cutover - #376

Merged
ayushjhanwar-png merged 3 commits into
mainfrom
revert/property-mv-routing
Jul 16, 2026
Merged

revert: property MV router (PRs #356/#358/#359) pending v2 cutover#376
ayushjhanwar-png merged 3 commits into
mainfrom
revert/property-mv-routing

Conversation

@ayushjhanwar-png

@ayushjhanwar-png ayushjhanwar-png commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Reverts the property MV router (PR #356, #358, #359) that route chart property-filter and breakdown-by-property queries to profile_event_property_summary_mv (v1).

Why revert now

The v1 MV filters WHERE profile_id != device_id on write, silently excluding anonymous events. For anonymous-heavy events this causes major undercounts:

  • installReferrer (dashreels): v1 held 0.6% of actual events (verified against events table on 07-05)
  • trialScreenOpen (dashreels): only 79.1% identified → v1 misses ~21%
  • Same behavior for cohort membership queries routed through the MV

Even with the MV_ROUTING_ALLOWED_PROJECTS = {'dashreels'} safety allowlist added in #358, several dashreels events fall below acceptable identify-rate thresholds. Users are seeing silently-wrong numbers.

Trade-off: dashboards fall back to events table (with existing skip indices on showName, source, searchType, etc.) — slower (2-8s vs 0.4s) but correct.

Restore path

Once profile_event_property_summary_v2 backfill completes for the last 3 months (PR #375 raised the backfill window; expected to finish ~5 days) and v2 has no anonymous-filter, we'll re-add routing that targets v2 → same fast path with correct counts. Tracking work in the v2 backfill and the plan at hazy-churning-parrot.md.

Files touched

Test plan

  • Merge triggers build + dev deploy
  • Confirm dashboard property-filter charts render (slower but correct)
  • Spot-check a chart with anonymous-heavy event (e.g. installReferrer) — should return larger, matching numbers vs raw events

Summary by CodeRabbit

  • Bug Fixes

    • Updated chart query routing to use the standard calculation path for charts with event-property filters or breakdowns, improving consistency of results.
  • Documentation

    • Removed the outdated conversion chart performance investigation document.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 44b91ba2-1f9f-4800-a825-5e05c9db4749

📥 Commits

Reviewing files that changed from the base of the PR and between 724a674 and f7f62be.

📒 Files selected for processing (2)
  • docs/conversion-chart-perf.md
  • packages/db/src/services/chart.service.ts
💤 Files with no reviewable changes (2)
  • docs/conversion-chart-perf.md
  • packages/db/src/services/chart.service.ts

📝 Walkthrough

Walkthrough

The chart service removes the property-level materialized-view query path, including its gating and SQL generation. The related conversion-chart performance documentation is also deleted.

Changes

Property materialized-view removal

Layer / File(s) Summary
Remove property MV routing
packages/db/src/services/chart.service.ts, docs/conversion-chart-perf.md
Deletes property materialized-view helpers, gates, and SQL generation, removes the corresponding getChartSql route, and deletes the conversion-chart performance document.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: reverting the property MV router pending the v2 cutover.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert/property-mv-routing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ayushjhanwar-png
ayushjhanwar-png merged commit bc42f57 into main Jul 16, 2026
5 checks passed
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