How Much Transaction Log Does REORGANIZE Really Generate? I Measured It
A while back I published , including the classic advice: reorganize in the middle band of fragmentation, rebuild above it, because “reorganize only logs the pages it actually moves.” In a LinkedIn discussion, Jeff Moden…
The Guard Clauses Your Index Rebuild Script Needs
Writing a loop that rebuilds fragmented indexes takes about ten minutes. Writing one you can safely leave running unattended at 2 AM takes considerably longer, and the difference is entirely in the guard clauses: the…
Stop Disabling Foreign Keys: Use a Topological Sort Instead
You inherit a PostgreSQL cleanup script. The very first line is:
|
1 |
SET SESSION_REPLICATION_ROLE TO REPLICA; |
It works. Every table gets wiped clean, no FK errors, no complaints. Then one day somebody adds a new table to the schema,…