Hi all,

I am not sure of the way attached database behaves in respect to locks and
could not find an answer in the documentation about it.

I have a very complex query which I simplify by using temporary tables.
However, this means that every time this complex query is executed, the
database is exclusively locked (because I create temporary tables and insert
the intermediate results into them).

This means that when data is read from my database I get exclusive lock, so
no two readers can read in parallel.

I thought to solve this by attaching another database I will create
temporarily for each query, and to place the temporary tables in this
attached temporary database. This way, *I think*, my main database will be
locked shared (I will only select from it) and the temporary database will
be locked exclusively. So I will be able to run such queries complex in
parallel.

Am I correct in my assumption that the attached database will be the only
one to be locked? Or maybe when database is attached the locks of the two
databases are common?

Thanks in advance,

Ran

Reply via email to