From out there on the moon, international politics look so petty. You want to grab a politician by the scruff of the neck and drag him a quarter of a million miles out and say, "Look at that!"
Hi - I'm running a database and I want the resultant query to give a lookup of the cumulative value based on two criteria. To allow for this to happen I have joined to queries (grouping the first) and creating an IIF statement that allows the results from the second to be totalled by SUM. The issue is that as both queries are relatively large (one 50k lines other is 750k lines) I think database is having to create all the lines before finally doing the SUM. And this extremely slow - any suggestions on a better way of doing this? (sorry if this explanation is poor I usually read through forums never written on them before!)
Adam Schwanz
@Reply 2 years ago
Yea I don't follow what's going on here. Could you elaborate more?
If the SUM is checking every single record, then youll have to load in every single record yea.
If you have criteria on the queries or anything, if those fields are not indexed, it would scan the full tables again. If they are indexed, it can get what records it needs from the index, which would be faster.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.