This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Four identical blank medals have different colored ribbons, and a hand attaches a red loop.

Breaking Ties Deterministically: Why ORDER BY Needs a Tie-Breaker

December 12, 2008
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Order By, SQL Paging, SQL Top

Tied scores can come back in any order, which breaks paging. Here is the one column that fixes it.

Read More
A thick open book with a vermilion ribbon bookmark deep in its pages, reading glasses resting on it under a lamp.

Pagination With OFFSET and FETCH

July 26, 2008
Pinal Dave
SQL Performance
SQL Index, SQL Order By, SQL Paging, SQL Server

OFFSET and FETCH make page-number queries readable, but deep pages scan past prior rows; keyset pagination keeps the next page focused.

Read More
Uneven cheese portions balance equally because the wider piece contains large holes.

Splitting a Big Table Into Equal Key Ranges for Batch Work

July 21, 2008
Pinal Dave
SQL Performance
Batch, Ranking Functions, SQL Paging, Temp Table

Equal-width key ranges fail when ids have gaps. NTILE cuts by row count instead, so every worker gets a fair share of the table.

Read More
A wooden cribbage board on a cafe table, a red peg marking where play stopped

Keyset Pagination: Next and Previous Pages Without OFFSET

November 5, 2007
Pinal Dave
SQL Performance
SQL Index, SQL Order By, SQL Paging, SQL Server

Build keyset pagination with a matching index, unique tie breaker, next and previous queries, and a fair deep-page comparison with OFFSET.

Read More
SQL SERVER - 2005 T-SQL Paging Query Technique Comparison (OVER and ROW_NUMBER()) - CTE vs. Derived Table

SQL SERVER – 2005 T-SQL Paging Query Technique Comparison (OVER and ROW_NUMBER()) – CTE vs. Derived Table

June 11, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Joins, SQL Paging, SQL Scripts, SQL Server

Paging in SQL Server 2005 with ROW_NUMBER: CTE vs. derived table. I compare both methods and show they give the same performance for common queries.

Read More
Previous 1 2
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com