Skip to content

Commit

Permalink
use lightweight deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
iuwqyir committed Dec 3, 2024
1 parent 32f151a commit 5056f39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/storage/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ func (c *ClickHouseConnector) DeleteBlockData(chainId *big.Int, blockNumbers []*
}

func (c *ClickHouseConnector) deleteBatch(chainId *big.Int, blockNumbers []*big.Int, table string, blockNumberColumn string) error {
query := fmt.Sprintf("ALTER TABLE %s.%s DELETE WHERE chain_id = ? AND %s IN (?)", c.cfg.Database, table, blockNumberColumn)
query := fmt.Sprintf("DELETE FROM %s.%s WHERE chain_id = ? AND %s IN (?)", c.cfg.Database, table, blockNumberColumn)

blockNumbersStr := make([]string, len(blockNumbers))
for i, bn := range blockNumbers {
Expand Down

0 comments on commit 5056f39

Please sign in to comment.