> Hi,
> That was my initial thought, but sometimes doing the exact same query
> takes just a long as the first time. Other times if I try querying on
> something I have not tried before, its blazing fast, and than the next
> time (same query) its slow which is just the opposite of what you would
> expect.
That can still happen, IF you are not the sole user of the system. So,
if another query from somewhere else does a full scan of the table, it
will put those rows into the db buffers, and when you run your first
new query, it will find all of the needed data in memory and run fast
(using lots of CPU). Then, some other query runs against other tables,
needs pages in the buffer, and so DB2 starts tossing data from you
table out of memory, and when you run the exact same query later, DB2
needs to pull that data back in off of disc, which is slow and doesn't
use as much CPU.
-Chris
shawno - 30 Nov 2006 17:30 GMT
Hi,
Actually, at this point I am the only user accessing the database as it
still in the development phase.
I did notice something else that maybe somebody can shed some light on
(maybe I'll start a new thread as well). In command editor, I tried
doing an 'execute and access plan' so that it created the little
flowchart diagram and there was a difference.
For the fast queries, the access plan looked like:
[database name] ---> [tbscan(3) 531,908] ---> [return(1) 531,908]
The slow queries were as follows:
[database name] ---> [tbscan(5) 1,013,551] ---> [tqueue(3)] --->
[return(1) 1,013,551]
The slower queries had a tqueue entry, whatever that is.
> That can still happen, IF you are not the sole user of the system. So,
> if another query from somewhere else does a full scan of the table, it
[quoted text clipped - 7 lines]
>
> -Chris