Skip to content

Commit

Permalink
Add index to attributes -> events to match pindexer
Browse files Browse the repository at this point in the history
  • Loading branch information
cronokirby committed Sep 11, 2024
1 parent d095031 commit d01c8ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/indexer/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ CREATE TABLE IF NOT EXISTS attributes (
UNIQUE (event_id, key)
);

CREATE INDEX IF NOT EXISTS idx_attributes_event_id ON attributes(event_id);

CREATE OR REPLACE VIEW event_attributes AS
SELECT block_id, tx_id, type, key, composite_key, value
FROM events LEFT JOIN attributes ON (events.rowid = attributes.event_id);
Expand Down

0 comments on commit d01c8ea

Please sign in to comment.