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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,704
Office Version
  1. 2016
Platform
  1. Windows
What does the SQL look like?

Have you tried automating this with VBA code?
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
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
 

james_lankford

Well-known Member
Joined
Jan 11, 2009
Messages
1,181
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 ?
 

Watch MrExcel Video

Forum statistics

Threads
1,129,752
Messages
5,638,162
Members
417,011
Latest member
Amaden95

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
Top