Bugs item #1908822, was opened at 2008-03-06 16:25
Message generated for change (Settings changed) made by boncz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1908822&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/compiler
Group: Pathfinder CVS Head
Status: Open
Resolution: Postponed
>Priority: 1
Private: No
Submitted By: Stefan Manegold (stmane)
Assigned to: Stefan Manegold (stmane)
Summary: PFalg: fails to compile multi-join query

Initial Comment:
Both in the XQuery_0-22 release branch and the development head,
the following 4-way join query compiles fine with `pf -M`, but fails to compile 
with `pf -A`:

========
$ cat /tmp/dblp3.XQ
--------
let $d := doc('dblp.xml')
for $a1 in $d//article,
    $a2 in $d//article,
    $a3 in $d//article,
    $a4 in $d//article
where
    $a1/author/text() = $a2/author/text() and
    $a2/author/text() = $a3/author/text() and
    $a3/author/text() = $a4/author/text() and
    $a1/journal/text() = 'ACM Trans. Database Syst.' and
    $a2/journal/text() = 'Bioinformatics' and
    $a3/journal/text() = 'IEEE Trans. Knowl. Data Eng.' and
    $a4/journal/text() = 'Nucleic Acids Research'
return  $a3
========
$ pf -M /tmp/dblp3.XQ | wc
--------
   4804   19899  227036
========
$ pf -A /tmp/dblp3.XQ | wc
--------
fatal error: Mapping unique name to an original name failed.
# halted in 
/ufs/manegold/_/scratch0/Monet/Testing/Stable/source/pathfinder/compiler/algebra/algebra.c
 (PFalg_ori_name), line 916
      0       0       0
========

A slightly simpler version seems to compile well --- the warnings with `pf -A` 
occur only in the XQuery_0-22 branch:

========
$ cat /tmp/dblp2.XQ
--------
let $d := doc('dblp.xml')
for $a1 in $d//article,
    $a2 in $d//article,
    $a3 in $d//article
where
    $a1/author/text() = $a2/author/text() and
    $a2/author/text() = $a3/author/text() and
    $a1/journal/text() = 'ACM Trans. Database Syst.' and
    $a2/journal/text() = 'Bioinformatics' and
    $a3/journal/text() = 'IEEE Trans. Knowl. Data Eng.'
return  $a3
========
$ pf -M /tmp/dblp2.XQ | wc
--------
   3431   14222  158281
========
$ pf -A /tmp/dblp2.XQ | wc
--------
warning: variable a0000 stilled pinned once.
warning: variable a0001 stilled pinned once.
warning: variable a0002 stilled pinned once.
warning: variable a0003 stilled pinned once.
warning: variable a0004 stilled pinned once.
warning: variable a0005 stilled pinned once.
warning: variable a0006 stilled pinned once.
warning: variable a0007 stilled pinned once.
warning: variable a0008 stilled pinned once.
warning: variable a0009 stilled pinned once.
warning: variable a0010 stilled pinned once.
warning: variable a0011 stilled pinned once.
warning: variable a0012 stilled pinned once.
warning: variable a0013 stilled pinned once.
warning: variable a0014 stilled pinned once.
warning: variable a0015 stilled pinned once.
warning: variable a0016 stilled pinned once.
warning: variable a0017 stilled pinned once.
warning: variable a0018 stilled pinned once.
warning: variable a0019 stilled pinned once.
warning: variable a0020 stilled pinned once.
warning: variable a0021 stilled pinned once.
warning: variable a0022 stilled pinned once.
warning: variable a0023 stilled pinned once.
warning: variable a0024 stilled pinned once.
warning: variable a0025 stilled pinned once.
warning: variable a0026 stilled pinned once.
warning: variable a0027 stilled pinned once.
warning: variable a0028 stilled pinned once.
warning: variable a0029 stilled pinned once.
warning: variable a0030 stilled pinned once.
warning: variable a0031 stilled pinned once.
   2619    9795   83777
========


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

Comment By: Jan Rittinger (tsheyar)
Date: 2008-06-02 13:01

Message:
Logged In: YES 
user_id=993208
Originator: NO

This bug report is superseded by
http://sourceforge.net/tracker/index.php?func=detail&aid=1981762&group_id=56967&atid=482468

Only the test for the actual correctness of the generated plan(s) is still
pending
...

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

Comment By: Jan Rittinger (tsheyar)
Date: 2008-06-02 10:48

Message:
Logged In: YES 
user_id=993208
Originator: NO

The solution did not work out as expected (see also
https://sourceforge.net/tracker/index.php?func=detail&aid=1981491&group_id=56967&atid=482468).
For some queries the rewrites are so good that we run out of bit-encoded
column names. A complete overhaul of the optimization and property
inference phases is needed here.

For the release I checked in a fallback solution that at least avoids
errors.
For the head the resolution is pending.

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

Comment By: Stefan Manegold (stmane)
Date: 2008-05-29 16:46

Message:
Logged In: YES 
user_id=572415
Originator: YES

Added simple compilation test in
pathfinder/tests/BugTracker/Tests/multi-join_query_compile_error.SF-1908822.*
Seems to be working fine, now.

Test for the actual correctness of the generated plan(s) is still pending
...


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

Comment By: Jan Rittinger (tsheyar)
Date: 2008-05-29 13:55

Message:
Logged In: YES 
user_id=993208
Originator: NO

I added a core rewrite that resolves the problem reported here.

A better solution would be to get rid of the bit-encoded column names in
the algebra (as in some situations we need more than 32 columns).

The variable pinning problem was solved already a while ago.

A test that also checks the correctness of the resulting plan still needs
to be added.

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

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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to