Tay
likes garlic
- Local time
- Today, 22:28
- Joined
- May 24, 2002
- Messages
- 269
I wasn't sure of the best section for this, so opted for 'General'.
I have a db which records the results of accuracy checks across different workstreams carried out in our organisation. Aside from the accuracy side of things, it also logs date information. For three workstreams, I need to work out the clearance times between when a form is received and when it is actioned. Thanks to some working days code (which takes into account public holidays) which I found linked to on here, I am successfully calculating this for each check. But, it is running dreadfully slowly, and on occasion, it crashes my machine. At present, I'm working on copies of the FE and BE of the db, rather than the live version which is on the network in a multi-user environment.
I've compiled the db and found no problems. I don't know if it's running slowly because of the code, or the amount of calculations it needs to do. At present, there are around 4000 records to check and this grows by 1000 each month. The db has replaced an Excel spreadsheet which had the same function - it was replaced as it was so slow. I don't wish to impose another appallingly slow system on people, especially when Excel produced better reports!
The working days calculation runs in a query. However, I wonder if I should store the results in a table. The dates aren't going to change, so this shouldn't be a reason for not storing the calculation results this way. The problem is that in order to report in the way that managers want, I need to:
*calculate the working days to establish clearance time per check per month
*calculate the average clearance time per check per month
*calculate the number of checks cleared in more than 3 days per month
*calculate the % of checks cleared in under 3 days (this is then used on a cumulative basis) per month
Unless I'm being dense, I figured that I'd need to achieve this through a series of queries. So for the average clearance time, I first need to work out the clearance times, then sum them (per month), then take the mean. I can't do all that in one query.
This is where the slowness is happening. The initial query runs in about 35 seconds. But when I use this query as the basis of the next query, it gets a lot slower. I don't see this improving when I get to the next query (which will be based on the second).
Any advice would be grateful as I'm unsure how to proceed with this.
I have a db which records the results of accuracy checks across different workstreams carried out in our organisation. Aside from the accuracy side of things, it also logs date information. For three workstreams, I need to work out the clearance times between when a form is received and when it is actioned. Thanks to some working days code (which takes into account public holidays) which I found linked to on here, I am successfully calculating this for each check. But, it is running dreadfully slowly, and on occasion, it crashes my machine. At present, I'm working on copies of the FE and BE of the db, rather than the live version which is on the network in a multi-user environment.
I've compiled the db and found no problems. I don't know if it's running slowly because of the code, or the amount of calculations it needs to do. At present, there are around 4000 records to check and this grows by 1000 each month. The db has replaced an Excel spreadsheet which had the same function - it was replaced as it was so slow. I don't wish to impose another appallingly slow system on people, especially when Excel produced better reports!
The working days calculation runs in a query. However, I wonder if I should store the results in a table. The dates aren't going to change, so this shouldn't be a reason for not storing the calculation results this way. The problem is that in order to report in the way that managers want, I need to:
*calculate the working days to establish clearance time per check per month
*calculate the average clearance time per check per month
*calculate the number of checks cleared in more than 3 days per month
*calculate the % of checks cleared in under 3 days (this is then used on a cumulative basis) per month
Unless I'm being dense, I figured that I'd need to achieve this through a series of queries. So for the average clearance time, I first need to work out the clearance times, then sum them (per month), then take the mean. I can't do all that in one query.
This is where the slowness is happening. The initial query runs in about 35 seconds. But when I use this query as the basis of the next query, it gets a lot slower. I don't see this improving when I get to the next query (which will be based on the second).
Any advice would be grateful as I'm unsure how to proceed with this.