Skip to content

Conversation

@estensen
Copy link
Contributor

No description provided.

estensen and others added 2 commits August 18, 2025 15:02
…ocks

Implements automatic deduplication for batches and batch_blocks tables using
ReplacingMergeTree engine to address duplicate data issues from gap detection
and backfill operations.

Key changes:
- Migration tracking system with schema_migrations table (migration 019)
- ReplacingMergeTree shadow tables with optimized indexing (migration 020)
  - ORDER BY (batch_id) for optimal deduplication
  - Secondary indexes on inserted_at and l1_block_number for query performance
- Data migration with argMax() deduplication (migration 021, MANUAL)
- Atomic table swap with rollback plan (migration 022, MANUAL)
- Automated cleanup of old tables (migration 023)

Performance optimizations:
- Primary key (batch_id) optimizes most common JOIN patterns
- Secondary index on inserted_at maintains monitoring query performance
- Secondary index on l1_block_number maintains L1-based query performance
- Preserved projections for l2_block_number lookups

Migration strategy:
- Safe startup migrations (019, 020, 023) run automatically
- Data-intensive operations (021, 022) require manual execution
- MANUAL suffix prevents automatic execution during startup
- Comprehensive documentation and rollback procedures included

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@vercel
Copy link

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
taikoscope Ignored Ignored Preview Aug 18, 2025 1:32pm

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.

2 participants