On Jan 11, 4:09 am, runic <ru...@[EMAIL PROTECTED]
> wrote:
> Hello and sorry,
>
> in an english group i should write not in german,
> just wondering why i get no answer ;-(
>
> My Question is, where Results of a SELECT (HSQLDB/JDBC)
> are cached and how i can "switch off" the caching.
>
> I called a SELECT in a JUnit Task which first open a
> connection to DB, do the SELECT and close the connection.
> The program stops.
>
> When I started the program twice, the duration of first
> run is e.g. a minute, second run takes 3 seconds. But,
> because the program doesn't run during 2 calls, where
> are the results cached? Has WinXP its finger in the pie?
>
> And second, how can i switch off the caching? I want to
> use the duration of certain SELECTs as a "Benchmark"
> to compare one SELECT with another. But cached are
> falsified results.
>
> Can you please give me a hint, who is caching (i think
> not HSQLDB?) and how i can avoid it?
>
> TIA, Det
Roedy hit the point. This has nothing to do with your application
or the OS. If you owned a shop and every saturday, an old lady
came in wanting to buy 1,000 brooms. You'd give her the few you had
on hand, and maybe order the rest and get it to her ASAP, but after
2 weeks like this, you'd probably start every saturday with 1,000
brooms in your shop, and the transaction would go a lot quicker.
The DBMS has more data than can fit in semiconductor memory,
so it keeps whatever's been needed recently until it is forced to
clear it out to make room for something else.
If you want to normalize your test, you must ensure the DBMS is
always in the same state to start. You can do this by either
booting the DBMS fresh for the test, or pre-running your test before
officially measuring, or running some huge irrelevant query to
pre-fill the DBMS cache with data you don't need.
Joe Weinstein at BEA Systems


|