Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions migrations/006_add_root_parent_columns.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Add root parent tracking columns for efficient thread identification
-- Root casts have NULL values; replies have values pointing to the thread root

ALTER TABLE public.casts ADD COLUMN root_parent_fid bigint;
ALTER TABLE public.casts ADD COLUMN root_parent_hash bytea;
ALTER TABLE public.casts ADD COLUMN root_parent_url text;

-- Index for efficient thread lookups by root hash
CREATE INDEX casts_root_parent_hash_index ON public.casts USING btree (root_parent_hash)
WHERE (root_parent_hash IS NOT NULL);

-- Index for finding threads by author (the FID who started the thread)
CREATE INDEX casts_root_parent_fid_index ON public.casts USING btree (root_parent_fid)
WHERE (root_parent_fid IS NOT NULL);

-- Index for finding casts in URL-rooted threads (e.g., channel posts)
CREATE INDEX casts_root_parent_url_index ON public.casts USING btree (root_parent_url)
WHERE (root_parent_url IS NOT NULL);
1 change: 1 addition & 0 deletions src/backfill/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod bench;
pub mod onchain_events;
pub mod reconciler;
pub mod root_parent;
pub mod worker;
Loading