Use DELETE TOP safely through an ordered CTE, preview oldest rows, apply a supporting index, and remove eligible rows in bounded batches.
SQL SERVER – Techniques for Retrieving Random Rows
This post will explore various techniques to retrieve random rows in SQL Server and analyze their performance and randomness characteristics in depth.
SQL SERVER – Top 1 and Index Scan
Scans are not always bad they are there because they are needed. Let us see a very simple demonstration about Top 1 and Index Scan.
Top N Plus Others: Grouping the Rest Into One Row
Create top N plus others summaries with deterministic category ranking, one remainder total, stable labels, and explicit display ordering.
Top N per Group: Three Ways and Which Is Fastest
Compare top N per group with ROW_NUMBER, APPLY and a correlated subquery, define tie behavior, and measure plans with a supporting index.
Row Goals: Why TOP and EXISTS Change the Plan
Inspect row goals from TOP and EXISTS, read EstimateRowsWithoutRowGoal, and compare a targeted optimizer hint using actual plans.





