Let's say that I have a long running query SELECT
and this query holds a AccessShareLock
on a table. While this query is being processed a new query which needs a AccessExclusiveLock
on the table REINDEXDB
is made. I suppose this query must wait the other query to finish, becuase they have conflicting locks. And while my REINDEXDB
query is waiting for the SELECT
query to finish, a second SELECT
query is made. Now my question is
Which query will be serviced first? REINDEXDB
or SELECT
? Select query has been made later but it doesn't have a conflicting lock with the ongoing select query. So will they be processed in parallel? Or because REINDEXDB
query has been made earlier will the second select query wait for REINDEXDB
to finish?