D
DamianC-UK
I have a problem, which is desperately in need of a solution, before my db
users lynch me!! So any help would be much appreciated...
I have an extremely complex query, which takes around 30 seconds to run.
The problem is that this query feeds around 10 other queries, which
ultimately produce a report.
10 * 30 seconds = you see the problem!!
When more than one user is in the database, the main complex query takes
more than 30 seconds to run, 10 * more than 30 seconds = Very slow!!
The database is networked, and has a BE/FE structure, but the FE is also on
the network, due to IT restrictions on local PC's).
This database is in use by around 15 users at any time.
As an overview of what the db does:
It contains team members names, and then stores performance information for
a host of (10+) KPI's, with raw data stored in individual tables, as the data
comes from external sources. This needs to be calculated into the performance
results and then referenced to each individual, before being returned by
team, individual, department or for the whole company.
Due to the nature of the business, there are frequent changes to where each
team member is working, and this data needs to follow where they have been at
any point, as KPI's are different for each area, but the core data is the
same.
The main complex query looks up each team members whereabouts by date, from
a table that tracks team movements, this is then used in all the other
queries to calculate the KPI's against the correct measures, depending which
team you were in on each date.
I've looked at changing the main query into a make table to fix this
problem, and while this fixes the speed issue to a degree, it creates the
problem of balooning the size of the database, by hundreds of Mb a day.
So my question is this:
Is it possible to (either in VBA, or in queries) make this complex query run
once, store the results for reference in subsequent queries, without having
to rerun the main query each time?
I'd thought about doing this in VBA, but am not sure where to start with this.
I will quite happily share SQL etc, but want to keep this as brief as
possible, as it's already quite complicated to explain.
Any support would be greatly appreciated.
Thanks
users lynch me!! So any help would be much appreciated...
I have an extremely complex query, which takes around 30 seconds to run.
The problem is that this query feeds around 10 other queries, which
ultimately produce a report.
10 * 30 seconds = you see the problem!!
When more than one user is in the database, the main complex query takes
more than 30 seconds to run, 10 * more than 30 seconds = Very slow!!
The database is networked, and has a BE/FE structure, but the FE is also on
the network, due to IT restrictions on local PC's).
This database is in use by around 15 users at any time.
As an overview of what the db does:
It contains team members names, and then stores performance information for
a host of (10+) KPI's, with raw data stored in individual tables, as the data
comes from external sources. This needs to be calculated into the performance
results and then referenced to each individual, before being returned by
team, individual, department or for the whole company.
Due to the nature of the business, there are frequent changes to where each
team member is working, and this data needs to follow where they have been at
any point, as KPI's are different for each area, but the core data is the
same.
The main complex query looks up each team members whereabouts by date, from
a table that tracks team movements, this is then used in all the other
queries to calculate the KPI's against the correct measures, depending which
team you were in on each date.
I've looked at changing the main query into a make table to fix this
problem, and while this fixes the speed issue to a degree, it creates the
problem of balooning the size of the database, by hundreds of Mb a day.
So my question is this:
Is it possible to (either in VBA, or in queries) make this complex query run
once, store the results for reference in subsequent queries, without having
to rerun the main query each time?
I'd thought about doing this in VBA, but am not sure where to start with this.
I will quite happily share SQL etc, but want to keep this as brief as
possible, as it's already quite complicated to explain.
Any support would be greatly appreciated.
Thanks