G
Guest
I have two update queries in a Microsoft Access database with the same
SQL, but one runs in <0.003 sec and the other runs in >2.000 sec. The
second one is slower because it has a query plan that is not optimal
for the data currently in the database.
After I compact the database, I would expect the queries to be
recompiled so that they both run fast. In fact, the opposite is true –
both take >2.000 sec to run.
I have posted my database on: http://www.geocities.com/milewskp/ee/
(then click on FastSlowTX.zip ). When you extract and then open the
mdb file, you will see the two queries: qryFast and qrySlow.
Initially, qryFast is fast and qrySlow is slow, but after you compact
the database, they will both be slow.
My Question:
How can I redesign the query so that it runs in < 0.003sec after compaction?
SQL, but one runs in <0.003 sec and the other runs in >2.000 sec. The
second one is slower because it has a query plan that is not optimal
for the data currently in the database.
After I compact the database, I would expect the queries to be
recompiled so that they both run fast. In fact, the opposite is true –
both take >2.000 sec to run.
I have posted my database on: http://www.geocities.com/milewskp/ee/
(then click on FastSlowTX.zip ). When you extract and then open the
mdb file, you will see the two queries: qryFast and qrySlow.
Initially, qryFast is fast and qrySlow is slow, but after you compact
the database, they will both be slow.
My Question:
How can I redesign the query so that it runs in < 0.003sec after compaction?