Skip to content

Commit 5056f39

Browse files
committed
use lightweight deletes
1 parent 32f151a commit 5056f39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/storage/clickhouse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ func (c *ClickHouseConnector) DeleteBlockData(chainId *big.Int, blockNumbers []*
10031003
}
10041004

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

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

0 commit comments

Comments
 (0)