Press "Enter" to skip to content

The READPAST Query Hint

Chad Callihan gives us a hint:

Have you ever heard of the READPAST query hint? I would say it’s kind of a sibling to NOLOCK. With NOLOCK, you’ll get data back faster but risk dirty reads. With READPAST, SQL Server will skip right past locked data altogether. This can either be helpful or, if you don’t know how it’s used, incredibly dangerous.

Read on to see what it does. I’m not sure I’ve ever used READPAST before, but I’m also using read committed snapshot isolation whenever I can, so that would limit the utility of the READPAST hint. I don’t have the visceral disgust with READPAST that I do with NOLOCK, though I suppose the reason for that is just how uncommon the former is, whereas every bad code base I run into is inundated with NOLOCK everywhere.