From: Wolfgang M. <wol...@ex...> - 2004-04-19 12:19:40
|
Hi, If you look at eXist's log output, you will find that compiling the query=20 takes much longer than executing the query. Using client.sh -ls, compilatio= n=20 takes 900ms, query execution takes 140ms. Subsequent queries will be much=20 faster (59ms to compile, 5ms for query execution). The database has to fill= =20 its page buffers, so it needs some time to initialize itself. The strange thing is, however, that the first call to the XQuery compiler o= n a=20 freshly initialized database is a magnitude slower than later calls. I can'= t=20 explain this, but I suspect that the delay is caused by the Java classloade= r=20 (the XQueryContext uses introspection to load XQuery modules). If you still see performance problems, send me your data set and I will try= to=20 figure out what's wrong. Wolfgang On Saturday 17 April 2004 10:54, Yusuf U=F0ur Soysal wrote: > hi, > > I've read the xquery performence topics in the email > archive, but I couldn't be sure that my queries run at > normal speed. > > Here is the query: > xquery version "1.0"; > > for $player at $i in > collection('db/graduation/players')/nba/player > let $season :=3D > $player/career/pSeason[position()=3Dlast()] > let $val :=3D $season/assist/text() > where $i <=3D 30 > order by $val descending > return <player> > {$player/plyrName} > {$player/id} > <team>{$player/playingAt/text()}</team> > {$season/game} > <val>{$val}</val> > </player> > > And the xml file, that I'm queriying is at the bottom > of the email. This queries took about 1.5 - 2 seconds > and there are 408 xml files in the collection. Is the > speed is normal? It seems a little slow to me. > > An example of the xml file: > <?xml version=3D"1.0" encoding=3D"UTF-8"?> > <nba > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" > xsi:noNamespaceSchemaLocation=3D"xsd/nba.xsd"> > <player> > <id>2</id> > <plyrName>Boris Diaw</plyrName> > <dateOfBirth>16/4/82</dateOfBirth> > <height>6-8</height> > <weight>215</weight> > <position>G</position> > <playingAt link=3D"1">Atlanta Hawks</playingAt> > <highScores> > <point>0</point> > <minute>0</minute> > <fieldGoal> > <made>0</made> > <attempted>0</attempted> > </fieldGoal> > <threePoint> > <made>0</made> > <attempted>0</attempted> > </threePoint> > <freeThrow> > <made>0</made> > <attempted>0</attempted> > </freeThrow> > <hRebound> > <offensive>0</offensive> > <defensive>0</defensive> > <total>0</total> > </hRebound> > <assist>0</assist> > <steal>0</steal> > <block>0</block> > </highScores> > <career> > <pSeason year=3D"03-04"> > <teamName link=3D"1">Atlanta > Hawks</teamName> > <game>0</game> > <point>0</point> > <minute>0</minute> > <fieldGoal> > <made>0</made> > <attempted>0</attempted> > </fieldGoal> > <threePoint> > <made>0</made> > <attempted>0</attempted> > </threePoint> > <freeThrow> > <made>0</made> > <attempted>0</attempted> > </freeThrow> > <pRebound> > <offensive>0</offensive> > <defensive>0</defensive> > </pRebound> > <assist>0</assist> > <steal>0</steal> > <block>0</block> > <turnover>0</turnover> > <personalFoul>0</personalFoul> > </pSeason> > </career> > </player> > </nba> > > > =3D=3D=3D=3D=3D > http://students.sabanciuniv.edu/~ocelep/shadow/ |