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,…
The psqlODBC Driver Is Eating Your RAISE NOTICE Messages
I just spent two days debugging a problem where my PowerShell script was logging 900 lines of output instead of 150. The script worked fine for months. Then someone added more tables to the process,…
CHECKPOINT and Simple Recovery Model
This article shows how checkpoint and simple recovery model works. For databases configured with the “simple” recovery model, it’s important to understand how checkpoints work1 under simple recovery model to avoid running out of log…
Blocking Example Code
In our previous post we looked at detecting and analyzing blocking. This post contains a script with blocking example code. Output from the analysis samples contained in the previous post is also provided. Blocking Example…
Blocked Process Detection and Analysis
Blocked process detection provides the DBA an excellent tool for improving the apparent responsiveness of SQL Server. This post provides example code for creating a blocked process Extended Events capture session. Also included is a…
Deadlock Detection and Analysis
Deadlock detection and analysis in SQL Server is important for the overall health of affected applications. This post shows how to setup an Extended Events session to capture deadlock details. It also provides a stored…