SQL Server Science
Technical Articles for the DBA / Developer
Home » database-maintenance

How Much Transaction Log Does REORGANIZE Really Generate? I Measured It

2026-08-19 · by Hannah Vernon · in maintenance

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

2026-07-25 · by Hannah Vernon · in maintenance

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

2026-05-20 · by Hannah Vernon · in troubleshooting

You inherit a PostgreSQL cleanup script. The very first line is:

Transact-SQL
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,…

Search

Categories

  • AI for DBAs
  • announcements
    • events
  • basics
    • localization
  • configuration
  • Data Architecture
  • DMVs
  • documentation
  • extended-events
  • Git for DBAs
  • High Availability
  • Hot Takes
  • Internals
  • maintenance
    • patching
  • Opinion
  • performance
  • PostgreSQL
  • Professional Development
  • recovery
  • reporting
  • ROLLBACK;
  • security
    • data security
  • service broker
  • SQL Server Agent
  • statistics
  • sys
  • t-sql
    • xml
  • tools
    • data masking
    • wsus
  • troubleshooting
  • Uncategorized

Pages

  • About SQL Server Science
  • Get Better Help with a Minimal, Complete, and Verifiable Example, or MCVE
  • Privacy Policy

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.

To find out more, including how to control cookies, see here: Cookie Policy

Copyright © 2026 SQL Server Science