Inexplicably slow query

crozfader

Board Regular
Joined
Mar 23, 2011
Messages
86
Hi All.

I have a huge query that joins ten different tables and returns around 100 columns.

When I execute the query, it takes less than a minute to run...


If I create a "make table query" with the same, i.e. I just want to store the results of the query in a permanent table, it takes forever (been running for 30 mins, looks like Access is frozen).

Any ideas why this is happenning?

I've indexed most of the join fields to speed up the query.

Thanks
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
What does the SQL look like?

Have you tried automating this with VBA code?
 
Upvote 0
Is this a UNION query? If so, have you considered running each part of the query in turn and appending the result to a table?

Denis
 
Upvote 0
try making a 2nd query
make the 2nd one the "make table" query and use the original "select" query as its source

and are you making the table in the local Access db?
or is it attached, so that you're attempting to make the table in SQL Server or another Access db ?
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top