Bugs item #2144639, was opened at 2008-10-03 18:25
Message generated for change (Comment added) made by lafanasi
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2144639&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: PF general
Group: Pathfinder 0.24
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Loredana Afanasiev (lafanasi)
Assigned to: Lefteris Sidirourgos (lsidir)
Summary: XQ: fn:collection() in algebra version

Initial Comment:
Hi Lefteris,

as discussed on Thu, I add this as a bug, so that you can close it soon :)

[EMAIL PROTECTED] xq]$ mclient -lx -s 'fn:collection("MotiesTweedeKamer")'
MAPI  = [EMAIL PROTECTED]:50000
QUERY = fn:collection("MotiesTweedeKamer")
ERROR = !fatal error: Algebra implementation for function `fn:collection' 
unknown.

Thanks,
l.

----------------------------------------------------------------------

>Comment By: Loredana Afanasiev (lafanasi)
Date: 2008-10-08 15:13

Message:
Subject:    fn:collection() vs pf:collection()

Hi Lefteris and all,

I think this relevant to this bug report.

I get huge performance times difference when switching from
fn:collection() to pf:collection(). I can you please advise me how to avoid
the long times while running on algebra version?

thanks in advance,
l.


[EMAIL PROTECTED] xq]$ more q9-fn.xq 
                let $col := fn:collection("MotiesTweedeKamer")
                for $y in distinct-values(for $y in $col//hiddendatum
return substring-before(fn:str
ing($y),'.'))
                let $thisyear := $col//document
                   
[substring-before(fn:string(.//hiddendatum[1]),'.')=$y]
                let $partij := distinct-values($thisyear//partij)
                for $p in $partij
                let $aantalingediendemoties :=
                    count($thisyear[.//indienergnlod//partij=$p])
                let $aantalmedeingediendemoties := 
                    count($thisyear[.//medeindienergnlod//partij=$p])
                order by $y descending,
                    $aantalingediendemoties descending,
                    $aantalmedeingediendemoties descending
                return 
                <aantal jaar='{$y}'
                  partij='{$p}' 
                  aantalingediendemoties='{$aantalingediendemoties}'
                 
aantalmedeingediendemoties='{$aantalmedeingediendemoties}'
                />

[EMAIL PROTECTED] xq]$ mclient -lx -g -t q9-fn.xq

Trans      35.174 msec
Shred       0.000 msec
Query    4401.659 msec
Print       2.680 msec
Timer    4487.610 msec 


[EMAIL PROTECTED] xq]$ more q9-pf.xq 
                let $col := pf:collection("MotiesTweedeKamer")
                for $y in distinct-values(for $y in $col//hiddendatum
return substring-before(fn:str
ing($y),'.'))
                let $thisyear := $col//document
                   
[substring-before(fn:string(.//hiddendatum[1]),'.')=$y]
                let $partij := distinct-values($thisyear//partij)
                for $p in $partij
                let $aantalingediendemoties :=
                    count($thisyear[.//indienergnlod//partij=$p])
                let $aantalmedeingediendemoties := 
                    count($thisyear[.//medeindienergnlod//partij=$p])
                order by $y descending,
                    $aantalingediendemoties descending,
                    $aantalmedeingediendemoties descending
                return 
                <aantal jaar='{$y}'
                  partij='{$p}' 
                  aantalingediendemoties='{$aantalingediendemoties}'
                 
aantalmedeingediendemoties='{$aantalmedeingediendemoties}'
                />

[EMAIL PROTECTED] xq]$ mclient -lx -t q9-pf.xq

Timer  584185.070 msec

[EMAIL PROTECTED] xq]$ diff q9-fn.xq q9-pf.xq 
1c1
<                 let $col := fn:collection("MotiesTweedeKamer")
---
>                 let $col := pf:collection("MotiesTweedeKamer")


Besides this there is something strange happening with pf:collection().
The website says:
"
pf:collection() returns a single special collection node, whose immediate
children are the document nodes. Therefore, fn:collection("my-collection")
is roughly equivalent to pf:collection("my-collection")/*. 
"

While I get:

[EMAIL PROTECTED] xq]$ mclient -lx -g -s
'count(fn:collection("MotiesTweedeKamer"))'
27946
[EMAIL PROTECTED] xq]$ mclient -lx -g -s
'count(pf:collection("MotiesTweedeKamer"))'
1
[EMAIL PROTECTED] xq]$ mclient -lx -g -s
'count(pf:collection("MotiesTweedeKamer")/*)'
0
[EMAIL PROTECTED] xq]$ mclient -lx  -s
'count(pf:collection("MotiesTweedeKamer")/*)'
0
[EMAIL PROTECTED] xq]$ mclient -lx -s
'count(pf:collection("MotiesTweedeKamer")/*/*)'
0
[EMAIL PROTECTED] xq]$ mclient -lx -s
'count(pf:collection("MotiesTweedeKamer")/*/document)'
0
[EMAIL PROTECTED] xq]$ mclient -lx -s
'count(pf:collection("MotiesTweedeKamer")//document)'
27946



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2144639&group_id=56967

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to