You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use VersionedCollapsingMergeTree and insert based deletes (#149)
### TL;DR
Migrated database tables from ReplacingMergeTree to VersionedCollapsingMergeTree engine and updated column names for better consistency.
### What changed?
- Replaced lightweight deletes with inserts for blocks, logs, transactions and traces
- Changed database engine from ReplacingMergeTree to VersionedCollapsingMergeTree
- Added `sign` and `insert_timestamp` columns for versioning support
- Renamed block table columns for consistency:
- `number` -> `block_number`
- `timestamp` -> `block_timestamp`
- Updated block timestamp type from UInt64 to DateTime
- Optimized index granularity settings
- Adjusted table ordering to use block_timestamp
- Removed nullable constraints from certain columns
- Updated corresponding Go structs to match new schema
- Added option to force consistent data (uses FINAL with clickhouse)
### How to test?
1. Drop existing tables
2. Run new table creation scripts
3. Verify data insertion works with new schema
4. Test data retrieval using updated column names
5. Verify versioning works by inserting duplicate records
6. Confirm proper handling of deleted records
### Why make this change?
- Better support for data versioning and deletion tracking
- Improved data consistency with standardized column naming
- Enhanced query performance through optimized indexing
- More efficient handling of data updates and deletions
- Better type handling for timestamp-related operations
0 commit comments