Perform sql_pop delete in bulk instead of one-at-a-time.
Prior to 506104686b
these DELETEs had been done in large batches (of
DEFAULT_PEEK_COUNT size), but that naive method of choosing rows to
delete was unsafe. Here we continue to keep track of which rows must
be deleted as we process them.
This commit is contained in:
@ -191,7 +191,7 @@ CREATE VIEW repack.tables AS
|
||||
'INSERT INTO repack.table_' || R.oid || ' VALUES ($1.*)' AS sql_insert,
|
||||
'DELETE FROM repack.table_' || R.oid || ' WHERE ' || repack.get_compare_pkey(PK.indexrelid, '$1') AS sql_delete,
|
||||
'UPDATE repack.table_' || R.oid || ' SET ' || repack.get_assign(R.oid, '$2') || ' WHERE ' || repack.get_compare_pkey(PK.indexrelid, '$1') AS sql_update,
|
||||
'DELETE FROM repack.log_' || R.oid || ' WHERE id = $1' AS sql_pop
|
||||
'DELETE FROM repack.log_' || R.oid || ' WHERE id IN (' AS sql_pop
|
||||
FROM pg_class R
|
||||
LEFT JOIN pg_class T ON R.reltoastrelid = T.oid
|
||||
LEFT JOIN repack.primary_keys PK
|
||||
|
Reference in New Issue
Block a user