Environment: java 1.5.0_01, Java HotSpot(TM) Server VM, Sun Microsystems Inc., Linux
Now running java nux.xom.tests.XQueryBenchmark 1000 2 cache samples/xmark/auction-0.01.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.01.xml ms=1195
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=1178, queries/sec=848.8965
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=3707, queries/sec=269.75992
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=3423, queries/sec=292.1414
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=2364, queries/sec=423.01184
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=806, queries/sec=1240.6948
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=2339, queries/sec=427.53314
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=18793, queries/sec=53.211304
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=136994, queries/sec=7.2995896
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=152449, queries/sec=6.5595703
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=35082, queries/sec=28.504646
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=125478, queries/sec=7.969525
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=68661, queries/sec=14.564308
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=2804, queries/sec=356.6334
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=11034, queries/sec=90.62896
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=864, queries/sec=1157.4073
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=1038, queries/sec=963.3912
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=3707, queries/sec=269.75992
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=2226, queries/sec=449.2363
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=9510, queries/sec=105.152466
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=2835, queries/sec=352.73367
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=168, queries/sec=5952.381
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=2876, queries/sec=347.70517
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=2804, queries/sec=356.6334
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=2334, queries/sec=428.449
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=677, queries/sec=1477.1049
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=2230, queries/sec=448.43048
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=18823, queries/sec=53.126495
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=139483, queries/sec=7.1693325
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=156253, queries/sec=6.399877
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=34519, queries/sec=28.969553
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=131006, queries/sec=7.6332383
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=70050, queries/sec=14.2755165
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=2452, queries/sec=407.83035
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=10914, queries/sec=91.62544
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=828, queries/sec=1207.7295
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=992, queries/sec=1008.0645
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=3805, queries/sec=262.81207
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=1507, queries/sec=663.57
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=9837, queries/sec=101.65701
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=2854, queries/sec=350.3854
done with repetition 1