Environment: java 1.5.0_01, Java HotSpot(TM) Server VM, Sun Microsystems Inc., Linux Now running java nux.xom.tests.XQueryBenchmark 10 2 cache samples/xmark/auction-0.1.xml samples/xmark/q01.xq samples/xmark/q02.xq samples/xmark/q03.xq samples/xmark/q04.xq samples/xmark/q05.xq samples/xmark/q06.xq samples/xmark/q07.xq samples/xmark/q08.xq samples/xmark/q09.xq samples/xmark/q10.xq samples/xmark/q11.xq samples/xmark/q12.xq samples/xmark/q13.xq samples/xmark/q14.xq samples/xmark/q15.xq samples/xmark/q16.xq samples/xmark/q17.xq samples/xmark/q18.xq samples/xmark/q19.xq samples/xmark/q20.xq Now reading samples/xmark/auction-0.1.xml ms=2726 Now reading samples/xmark/q01.xq query = (: Q1.Return the name of the person with ID `person0' registered in North America. :) for $b in /site/people/person[@id="person0"] return $b/name/text() ms=937, queries/sec=10.6723585 Now reading samples/xmark/q02.xq query = (: Q2. Return the initial increases of all open auctions. :) for $b in /site/open_auctions/open_auction return {$b/bidder[1]/increase/text()} ms=1739, queries/sec=5.7504315 Now reading samples/xmark/q03.xq query = (: Q3. Return the IDs of all open auctions whose current :) (: increase is at least twice as high as the initial increase. :) for $b in /site/open_auctions/open_auction where $b/bidder[1]/increase/text() * 2 <= $b/bidder[last()]/increase/text() return ms=1048, queries/sec=9.541985 Now reading samples/xmark/q04.xq query = (: Q4. List the reserves of those open auctions where a :) (: certain person issued a bid before another person. :) for $b in /site/open_auctions/open_auction where $b/bidder/personref[@person="person18829"] << $b/bidder/personref[@person="person10487"] return $b/reserve/text() ms=269, queries/sec=37.17472 Now reading samples/xmark/q05.xq query = (: Q5. How many sold items cost more than 40? :) count(for $i in /site/closed_auctions/closed_auction where $i/price/text() >= 40 return $i/price) ms=131, queries/sec=76.33588 Now reading samples/xmark/q06.xq query = (: Q6. How many items are listed on all continents? :) for $b in /site/regions return count ($b//item) ms=272, queries/sec=36.764706 Now reading samples/xmark/q07.xq query = (: Q7. How many pieces of prose are in our database? :) for $p in /site return count($p//description) + count($p//annotation) + count($p//email) ms=1672, queries/sec=5.980861 Now reading samples/xmark/q08.xq query = (: Q8. List the names of persons and the number of items they bought. :) (: (joins person, closed\_auction) :) for $p in /site/people/person let$a := for $t in /site/closed_auctions/closed_auction where $t/buyer/@person = $p/@id return $t return {count ($a)} ms=142375, queries/sec=0.07023705 Now reading samples/xmark/q09.xq query = (: Q9. List the names of persons and the names of the items they bought :) (: in Europe. (joins person, closed\_auction, item) :) for $p in /site/people/person let$a := for $t in /site/closed_auctions/closed_auction let$n := for $t2 in /site/regions/europe/item where $t/itemref/@item = $t2/@id return $t2 where $p/@id = $t/buyer/@person return {$n/name/text()} return {$a} ms=161471, queries/sec=0.061930627 Now reading samples/xmark/q10.xq query = (: Q10. List all persons according to their interest; :) (: use French markup in the result. :) for $i in distinct-values( /site/people/person/profile/interest/@category) let$p := for $t in /site/people/person where $t/profile/interest/@category = $i return {$t/gender/text()} , {$t/age/text()} , {$t/education/text()}, {$t/income/text()} , {$t/name/text()} , {$t/street/text()} , {$t/city/text()} , {$t/country/text()} , {$t/email/text()} , {$t/homepage/text()} , {$t/creditcard/text()} return {$i} , {$p} ms=20865, queries/sec=0.4792715 Now reading samples/xmark/q11.xq query = (: Q11. For each person, list the number of items currently on sale whose :) (: price does not exceed 0.02% of the person's income. :) for $p in /site/people/person let$l := for $i in /site/open_auctions/open_auction/initial where $p/profile/@income > (5000 * $i/text()) return $i return {count ($l)} ms=131084, queries/sec=0.076286964 Now reading samples/xmark/q12.xq query = (: Q12. For each richer-than-average person, list the number of items :) (: currently on sale whose price does not exceed 0.02% of the :) (: person's income. :) for $p in /site/people/person let $l := for $i in /site/open_auctions/open_auction/initial where $p/profile/@income > (5000 * $i/text()) return $i where $p/profile/@income > 50000 return {count ($l)} ms=53699, queries/sec=0.18622321 Now reading samples/xmark/q13.xq query = (: Q13. List the names of items registered in Australia along with their descriptions. :) for $i in /site/regions/australia/item return {$i/description} ms=746, queries/sec=13.404826 Now reading samples/xmark/q14.xq query = (: Q14. Return the names of all items whose description contains the word `gold'. :) for $i in /site//item where contains ($i/description,"gold") return $i/name/text() ms=1170, queries/sec=8.5470085 Now reading samples/xmark/q15.xq query = (: Q15. Print the keywords in emphasis in annotations of closed auctions. :) for $a in /site/closed_auctions/closed_auction/annotation/ description/parlist/listitem/parlist/listitem/text/emph/keyword/text() return {$a} ms=78, queries/sec=128.20512 Now reading samples/xmark/q16.xq query = (: Q16. Return the IDs of those auctions :) (: that have one or more keywords in emphasis. (cf. Q15) :) for $a in /site/closed_auctions/closed_auction where not( empty ($a/annotation/description/parlist/listitem/parlist/ listitem/text/emph/keyword/text())) return ms=107, queries/sec=93.45795 Now reading samples/xmark/q17.xq query = (: Q17. Which persons don't have a homepage? :) for $p in /site/people/person where empty($p/homepage/text()) return ms=352, queries/sec=28.409092 Now reading samples/xmark/q18.xq query = (: Q18.Convert the currency of the reserve of all open auctions to :) (: another currency. :) declare function local:convert ($v) { 2.20371 * $v (: convert Dfl to Euro :) }; for $i in /site/open_auctions/open_auction return local:convert($i/reserve) ms=1185, queries/sec=8.438819 Now reading samples/xmark/q19.xq query = (: Q19. Give an alphabetically ordered list of all :) (: items along with their location. :) for $b in /site/regions//item let $k := $b/name/text() order by $k return {$b/location/text()} ms=1173, queries/sec=8.525149 Now reading samples/xmark/q20.xq query = (: Q20. Group customers by their :) (: income and output the cardinality of each group. :) {count (/site/people/person/profile[@income >= 100000])} , {count (/site/people/person/profile[@income < 100000 and @income >= 30000])} , {count (/site/people/person/profile[@income < 30000])} , {count (for $p in /site/people/person where empty($p/@income) return $p)} ms=437, queries/sec=22.883295 done with repetition 0 Now reading samples/xmark/q01.xq query = (: Q1.Return the name of the person with ID `person0' registered in North America. :) for $b in /site/people/person[@id="person0"] return $b/name/text() ms=29, queries/sec=344.8276 Now reading samples/xmark/q02.xq query = (: Q2. Return the initial increases of all open auctions. :) for $b in /site/open_auctions/open_auction return {$b/bidder[1]/increase/text()} ms=257, queries/sec=38.910507 Now reading samples/xmark/q03.xq query = (: Q3. Return the IDs of all open auctions whose current :) (: increase is at least twice as high as the initial increase. :) for $b in /site/open_auctions/open_auction where $b/bidder[1]/increase/text() * 2 <= $b/bidder[last()]/increase/text() return ms=348, queries/sec=28.735634 Now reading samples/xmark/q04.xq query = (: Q4. List the reserves of those open auctions where a :) (: certain person issued a bid before another person. :) for $b in /site/open_auctions/open_auction where $b/bidder/personref[@person="person18829"] << $b/bidder/personref[@person="person10487"] return $b/reserve/text() ms=220, queries/sec=45.454544 Now reading samples/xmark/q05.xq query = (: Q5. How many sold items cost more than 40? :) count(for $i in /site/closed_auctions/closed_auction where $i/price/text() >= 40 return $i/price) ms=71, queries/sec=140.84506 Now reading samples/xmark/q06.xq query = (: Q6. How many items are listed on all continents? :) for $b in /site/regions return count ($b//item) ms=201, queries/sec=49.751244 Now reading samples/xmark/q07.xq query = (: Q7. How many pieces of prose are in our database? :) for $p in /site return count($p//description) + count($p//annotation) + count($p//email) ms=1681, queries/sec=5.94884 Now reading samples/xmark/q08.xq query = (: Q8. List the names of persons and the number of items they bought. :) (: (joins person, closed\_auction) :) for $p in /site/people/person let$a := for $t in /site/closed_auctions/closed_auction where $t/buyer/@person = $p/@id return $t return {count ($a)} ms=147847, queries/sec=0.06763749 Now reading samples/xmark/q09.xq query = (: Q9. List the names of persons and the names of the items they bought :) (: in Europe. (joins person, closed\_auction, item) :) for $p in /site/people/person let$a := for $t in /site/closed_auctions/closed_auction let$n := for $t2 in /site/regions/europe/item where $t/itemref/@item = $t2/@id return $t2 where $p/@id = $t/buyer/@person return {$n/name/text()} return {$a} ms=167783, queries/sec=0.059600793 Now reading samples/xmark/q10.xq query = (: Q10. List all persons according to their interest; :) (: use French markup in the result. :) for $i in distinct-values( /site/people/person/profile/interest/@category) let$p := for $t in /site/people/person where $t/profile/interest/@category = $i return {$t/gender/text()} , {$t/age/text()} , {$t/education/text()}, {$t/income/text()} , {$t/name/text()} , {$t/street/text()} , {$t/city/text()} , {$t/country/text()} , {$t/email/text()} , {$t/homepage/text()} , {$t/creditcard/text()} return {$i} , {$p} ms=19975, queries/sec=0.5006258 Now reading samples/xmark/q11.xq query = (: Q11. For each person, list the number of items currently on sale whose :) (: price does not exceed 0.02% of the person's income. :) for $p in /site/people/person let$l := for $i in /site/open_auctions/open_auction/initial where $p/profile/@income > (5000 * $i/text()) return $i return {count ($l)} ms=135993, queries/sec=0.0735332 Now reading samples/xmark/q12.xq query = (: Q12. For each richer-than-average person, list the number of items :) (: currently on sale whose price does not exceed 0.02% of the :) (: person's income. :) for $p in /site/people/person let $l := for $i in /site/open_auctions/open_auction/initial where $p/profile/@income > (5000 * $i/text()) return $i where $p/profile/@income > 50000 return {count ($l)} ms=55108, queries/sec=0.18146186 Now reading samples/xmark/q13.xq query = (: Q13. List the names of items registered in Australia along with their descriptions. :) for $i in /site/regions/australia/item return {$i/description} ms=286, queries/sec=34.965034 Now reading samples/xmark/q14.xq query = (: Q14. Return the names of all items whose description contains the word `gold'. :) for $i in /site//item where contains ($i/description,"gold") return $i/name/text() ms=1044, queries/sec=9.578544 Now reading samples/xmark/q15.xq query = (: Q15. Print the keywords in emphasis in annotations of closed auctions. :) for $a in /site/closed_auctions/closed_auction/annotation/ description/parlist/listitem/parlist/listitem/text/emph/keyword/text() return {$a} ms=71, queries/sec=140.84506 Now reading samples/xmark/q16.xq query = (: Q16. Return the IDs of those auctions :) (: that have one or more keywords in emphasis. (cf. Q15) :) for $a in /site/closed_auctions/closed_auction where not( empty ($a/annotation/description/parlist/listitem/parlist/ listitem/text/emph/keyword/text())) return ms=96, queries/sec=104.166664 Now reading samples/xmark/q17.xq query = (: Q17. Which persons don't have a homepage? :) for $p in /site/people/person where empty($p/homepage/text()) return ms=293, queries/sec=34.129692 Now reading samples/xmark/q18.xq query = (: Q18.Convert the currency of the reserve of all open auctions to :) (: another currency. :) declare function local:convert ($v) { 2.20371 * $v (: convert Dfl to Euro :) }; for $i in /site/open_auctions/open_auction return local:convert($i/reserve) ms=278, queries/sec=35.971222 Now reading samples/xmark/q19.xq query = (: Q19. Give an alphabetically ordered list of all :) (: items along with their location. :) for $b in /site/regions//item let $k := $b/name/text() order by $k return {$b/location/text()} ms=889, queries/sec=11.248594 Now reading samples/xmark/q20.xq query = (: Q20. Group customers by their :) (: income and output the cardinality of each group. :) {count (/site/people/person/profile[@income >= 100000])} , {count (/site/people/person/profile[@income < 100000 and @income >= 30000])} , {count (/site/people/person/profile[@income < 30000])} , {count (for $p in /site/people/person where empty($p/@income) return $p)} ms=292, queries/sec=34.246574 done with repetition 1