Commit e422918
feat(cold-sql): add topic indexes for log filtering (#54)
* feat(cold-sql): add topic1/topic2/topic3 indexes for log filtering
Only topic0 was indexed previously. Most ERC-20/721 Transfer event
lookups filter on topic1 (from address) or topic2 (to address),
causing sequential scans on the logs table.
Adds migration 002 with indexes on all three remaining topic columns.
Uses CREATE INDEX IF NOT EXISTS for idempotent application.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: consolidate duplicate topic index migration
The 002 migration SQL is dialect-agnostic (CREATE INDEX IF NOT EXISTS),
so a single file suffices for both PostgreSQL and SQLite. Removes the
duplicate _pg variant and uses a shared include_str! outside the
backend match arm.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c90dbff commit e422918
2 files changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
0 commit comments