J
John Slattery
I added a condition to the WHERE clause of a query that does not limit the
number of records returned and saw the execution time of the query decrease
dramatically. What's going on?
The query returns a little over a half million records from a database that
is about 80 MB in size and is somewhat complex in that it joins 24 tables.
The condition is that an incrementing autonumber field in one of the tables
is not equal to zero. Without this condition, I find that after ten minutes
about 20,000 records have been accessed, but with it, the entire half
million records are accessed in about 90 seconds.
By accessed, I mean this: launch the query from the database window by
double clicking and immediately press ctrl-down arrow to go to the last
record of the datasheet. With the constraint, I see the last record in 90
seconds. Without it, I give up at some point by pressing ctrl-break and
then hold the pgdn key until new pages of the datasheet suddenly nearly stop
appearing. After 10 minutes, this occurs at about 20,000 records.
Thanks,
John
number of records returned and saw the execution time of the query decrease
dramatically. What's going on?
The query returns a little over a half million records from a database that
is about 80 MB in size and is somewhat complex in that it joins 24 tables.
The condition is that an incrementing autonumber field in one of the tables
is not equal to zero. Without this condition, I find that after ten minutes
about 20,000 records have been accessed, but with it, the entire half
million records are accessed in about 90 seconds.
By accessed, I mean this: launch the query from the database window by
double clicking and immediately press ctrl-down arrow to go to the last
record of the datasheet. With the constraint, I see the last record in 90
seconds. Without it, I give up at some point by pressing ctrl-break and
then hold the pgdn key until new pages of the datasheet suddenly nearly stop
appearing. After 10 minutes, this occurs at about 20,000 records.
Thanks,
John