cancel
Showing results for 
Search instead for 
Did you mean: 
OloladeShelle
Level 2
Status: New

We noticed the following SQL query runs which causes a block on the Blue prims database and causes performance issues:

SELECT count(*) as TotalItems   FROM BPVWorkQueueItem i   LEFT JOIN BPVSessionInfo s   ON i.sessionid = s.sessionid   WHERE i.queueid=@queueid   AND (i.keyvalue is null   OR i.keyvalue like @itemkey)   AND i.state in (1,3)

Our suggestion: Consider using SELECT COUNT(1) to just count the number of records. This will give you the same results much faster without the unnecessary reads