Select top 1 with UPDLOCK and READPAST sets exclusive lock on the entire table

后端 未结 3 724
感动是毒
感动是毒 2021-01-05 04:44

I\'m using the UPDLOCK and READPAST sql hints in a stored procedure in order to implement a sort of a table queue (I say a sort because I select top 1500 instead of a top 1,

3条回答
  •  有刺的猬
    2021-01-05 05:29

    That table probably has too many columns and should be split up. Maybe it's not in proper 3rd or 4th normal form.

    Another thing would be to make sure there is a covering index specifically for your query.

提交回复
热议问题