We have a Database with a lot of tables and relationships. Queries that call other queries. The top level query that the user uses was taking 5-8 seconds. To get rid of this delay, we decided to do a daily make-table query, get all of the data in one large table and index it. So yes now all of the data is duplicated but the users have 0 wait time with their queries so everybody is happy.
Where it starts to get weird is... when I first set up this Make-Table query, all I did was take the user's top level query, copy it and change it to a Make-Table query. This Make-Table query, when ran in the Access UI, would take 15 minutes to run. I could never figure out why, since its only 20,000 records, allthough the end result is about 120 fields. Still, the Select query takes 5-8 seconds, so why 15 minutes for a Make-Table.
Where it really gets weird is...I wanted to automate this process so that this 15 minute query could be run at night, so I put it in a macro. All the macro does is open the very make-table query that I made above, with the UI and all, but it only takes 15 seconds instead of 15 minutes now. And guess what, if you go back to the Access UI and run the Make-table query from there, it only takes 15 seconds again. I can no longer make it take 15 minutes like it did originally. I deleted the tables just to be sure its actually doing its thing but sure enough, it re-creates them and all the data is there - 50 times faster.
So I'm obviously not complaining, this is what I wanted from the beginning, but does anybody have any ideas why? It seems pretty detrimental if other people's Make-Table queries go so slow if they don't really need to.
My Macro:
Set Warnings - Warnings On=NO
OpenQuery - Query Name = <The make-table query I made in the UI>; View = Datasheet; Data Mode=Edit
In case it's relevant:
The make-table query actually creates a table in another database, and the other database is on the Network.
Where it starts to get weird is... when I first set up this Make-Table query, all I did was take the user's top level query, copy it and change it to a Make-Table query. This Make-Table query, when ran in the Access UI, would take 15 minutes to run. I could never figure out why, since its only 20,000 records, allthough the end result is about 120 fields. Still, the Select query takes 5-8 seconds, so why 15 minutes for a Make-Table.
Where it really gets weird is...I wanted to automate this process so that this 15 minute query could be run at night, so I put it in a macro. All the macro does is open the very make-table query that I made above, with the UI and all, but it only takes 15 seconds instead of 15 minutes now. And guess what, if you go back to the Access UI and run the Make-table query from there, it only takes 15 seconds again. I can no longer make it take 15 minutes like it did originally. I deleted the tables just to be sure its actually doing its thing but sure enough, it re-creates them and all the data is there - 50 times faster.
So I'm obviously not complaining, this is what I wanted from the beginning, but does anybody have any ideas why? It seems pretty detrimental if other people's Make-Table queries go so slow if they don't really need to.
My Macro:
Set Warnings - Warnings On=NO
OpenQuery - Query Name = <The make-table query I made in the UI>; View = Datasheet; Data Mode=Edit
In case it's relevant:
The make-table query actually creates a table in another database, and the other database is on the Network.