Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

cached Betriebssystem Results?

 
   Database Forums (Home) -> Java RSS
Next:  [Announce] DataDirect XML Converters 3.1 Released..  
Author Message
runic

External


Since: Jan 11, 2008
Posts: 3



(Msg. 1) Posted: Fri Jan 11, 2008 1:03 am
Post subject: cached Betriebssystem Results?
Archived from groups: comp>lang>java>databases (more info?)

Hallo Gruppe,

ich mache gerade Performancetests für SELECTs auf einer HSQLDB-Tabelle
per JDBC. Die Tabelle ist nicht im Speicher, sondern als Datei auf der
Platte.

Natürlich würde ich die Messungen gerne wiederholbar machen, das
Problem
ist nur, dass der "erste" SELECT z.B. knapp eine Minute dauert,
wiederhole
ich denselben SELECT, benötigt der nur noch z.B. drei Sekunden.
Offensichtlich
wird irgendwo etwas gecached.

Was nur irritierend ist: ich mache den SELECT einzeln in einem JUnit-
Testcase,
in dem am Anfang die Connection zur DB gemacht wird und nach dem Test
wieder geschlossen wird. Also kann HSQLDB das Result doch nicht
cachen,
oder? In der Doku finde ich auch nichts entsprechendes.

Sollte WinXP etwa, auch wenn die Applikation zwischendurch beendet
ist,
Results speichern? Ein ähnliches Phänomen hatte ich mal beobachtet
bei PostgreSQL und Linux, hatte damals aber keine Veranlassung, mich
weiter darum zu kümmern.

Jetzt würde ich dieses Phänomen aber gerne "ausschalten", um
wiederholbare
Benchmark-Tests machen zu können. Ich wäre also für Hinweise in dieser
Richtung sehr dankbar.

Viele Grüße, Detlef

 >> Stay informed about: cached Betriebssystem Results? 
Back to top
Login to vote
runic

External


Since: Jan 11, 2008
Posts: 3



(Msg. 2) Posted: Fri Jan 11, 2008 4:09 am
Post subject: Re: cached Betriebssystem Results? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

 >> Stay informed about: cached Betriebssystem Results? 
Back to top
Login to vote
Roedy Green

External


Since: Nov 04, 2007
Posts: 35



(Msg. 3) Posted: Fri Jan 11, 2008 5:59 pm
Post subject: Re: cached Betriebssystem Results? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 11 Jan 2008 04:09:02 -0800 (PST), runic wrote,
quoted or indirectly quoted someone who said :

>Can you please give me a hint, who is caching (i think
>not HSQLDB?) and how i can avoid it?

The database of course caches. I doubt there is any way to turn that
off. The JDBC driver might also. It might be more amenable to
instruction. Check out the JDBC spec.

See http://mindprod.com/jgloss/jdbc.html
--
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com
 >> Stay informed about: cached Betriebssystem Results? 
Back to top
Login to vote
joe.weinstein

External


Since: Feb 21, 2005
Posts: 87



(Msg. 4) Posted: Sat Jan 12, 2008 7:55 am
Post subject: Re: cached Betriebssystem Results? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jan 11, 4:09 am, runic 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
 >> Stay informed about: cached Betriebssystem Results? 
Back to top
Login to vote
runic

External


Since: Jan 11, 2008
Posts: 3



(Msg. 5) Posted: Mon Jan 14, 2008 6:23 am
Post subject: Re: cached Betriebssystem Results? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hello Joe, thanks to you and Roedy,

thank you for your answers. It couldn't be JDBC, because the
JUnit Task is "off" during between to runs, the Library with
JDBC Driver is not in use. I could leave eclipse and start
it again, running the JUnit Task (with the SELECT) again,
this tasks duration is again lesser than after starting the
machine and run the Test for first.

> 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

Nice Example with an old Lady, buying brooms. I get it Wink

But the answer to my first question "who caches", would be
"the Operating system". And to the second part, "where can
i disable the cache", the answer have to be: "you can't
without admin rights".

Okay, Windows have a File Cache and what I sighted was the behaviour,
listed on http://www.mckoi.com/database/maillist/msg00502.html
where the poster get the same characteristics even after reboot,
first run takes more time than following.

Unfortunately I have no Admin Rights to clear the File Cache, so
I have to think about making dummy selection between duration tests,
as you supposed as third opportunity, Joe.

Thanks again, Detlef
 >> Stay informed about: cached Betriebssystem Results? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Two of three SQL stmts execute: third results in table doe.. - I attempt to collect data from a database three times in one method, all using one connection. The first two queries execute without any problem. However, the third fires an sql exception: java.sql.SQLSyntaxErrorException: Table/View 'TABLENAME' does....

2nd Globals Programming Challenge - USD $3,500 Grand Prize.. - Want to show how good you are at coding "Big Data" solutions? InterSystems Corp. is hosting a series of programming challenges in the Globals Community. Our 2nd Globals Challenge kicks off with a two day competition on Friday, December 02, 20...

algorithm for generating top fuzzy variations ... - Hello all, I am interested in obtaining the top N fuzzy variations of an string (a person or company name) using the same concept as the Levenshtein distance. Ussually Levenshtein is used to compute the distance between two given strings ... but I would...

Bug in Oracle org.w3c.dom.Node ? - Hello, I am using Oracle 10g for retrieving XML documents as XMLType and manipulate them in Java, using the method org.w3c.dom.Node.setTextContent() to set the text child node of a DOM node. The oracle DOM implementation just appends a child node to the...

JDBC vs SQLXML - Hi, I am writing an application in java which will write lots of data in database (i m using ms-sqlsqever) I want to know which approach is faster 1. JDBC "Batch Updates" OR 2. SQLXML BulkLoad. (Also if anybody can tell how to use SQLXML...
   Database Forums (Home) -> Java All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]