Files
insights/rust/cyclotron-node-migrations/20260731000001_add_null_person_anchor_index.sql
zeekay bc4ddf332b chore: rebase the tree onto upstream master fa1a9a60
Mechanically re-derived: bin/debrand runs over a fresh import of
posthog/posthog@fa1a9a60d4 (2026-08-06).
The pipeline (.hanzo/workflows), the Dockerfiles and bin/docker*
entrypoints, compose files, LLM.md and the squashed initial migration
are restored from the shipped tree, same as the previous import.

The prune's import-closure guard kept 21 products the new core now
imports; dropping them is a refactor now, recorded rather than forced.
2026-08-06 01:25:36 -07:00

8 lines
495 B
SQL

-- no-transaction
-- The matcher looks up parked waits with no person anchor on every distinct_id first mapping, which is a
-- high-volume stream. Only a handful of jobs lack an anchor at any moment, so a partial index keeps that
-- lookup to a few rows instead of leaning on the full (team_id, distinct_id) index.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_cyclotron_jobs_null_person_anchor
ON cyclotron_jobs (team_id, distinct_id)
WHERE person_id IS NULL AND distinct_id IS NOT NULL;