28msec / zorba

JSONiq & XQuery Query Processor
http://zorba.28.io/
Apache License 2.0
114 stars 22 forks source link

The query plan contains the plan of iterator before AND after optimization #43

Open fcavalieri opened 10 years ago

fcavalieri commented 10 years ago

vagrant@sausalito-devel-2-4-0:~/sausalito/build$ zorba/bin/zorba --iterator-tree json -q '42*42' { "description": "const-folded expr", "iterator-tree": { "kind": "GenericArithIterator_MultiplyOperation", "id": "0x1cf4550", "iterators": [ { "kind": "SingletonIterator", "value": "xs:integer(42)", "id": "0x1cf3680" }, { "kind": "SingletonIterator", "value": "xs:integer(42)", "id": "0x1cf4500" } ] } } { "description": "main query", "iterator-tree": { "kind": "SingletonIterator", "value": "xs:integer(1764)", "id": "0x1ce6610" } }

MatthiasBrantner commented 10 years ago

I don’t think that’s a bug. What is shown here is the expression that was constant folded and resulted in the singleton iterator.

On Jul 16, 2014, at 7:30 AM, Federico Cavalieri notifications@github.com wrote:

vagrant@sausalito-devel-2-4-0:~/sausalito/build$ zorba/bin/zorba --iterator-tree json -q '42*42' { "description": "const-folded expr", "iterator-tree": { "kind": "GenericArithIterator_MultiplyOperation", "id": "0x1cf4550", "iterators": [ { "kind": "SingletonIterator", "value": "xs:integer(42)", "id": "0x1cf3680" }, { "kind": "SingletonIterator", "value": "xs:integer(42)", "id": "0x1cf4500" } ] } } { "description": "main query", "iterator-tree": { "kind": "SingletonIterator", "value": "xs:integer(1764)", "id": "0x1ce6610" } }

— Reply to this email directly or view it on GitHub.

fcavalieri commented 10 years ago

I think the trace becomes unreadable, especially for real queries, no? Also what is the semantic of plan, if we print multiple time the same thing in different states? Can you try to convince me that it is correct?

On Wed, Jul 16, 2014 at 4:53 PM, MatthiasBrantner notifications@github.com wrote:

I don’t think that’s a bug. What is shown here is the expression that was constant folded and resulted in the singleton iterator.

On Jul 16, 2014, at 7:30 AM, Federico Cavalieri notifications@github.com wrote:

vagrant@sausalito-devel-2-4-0:~/sausalito/build$ zorba/bin/zorba --iterator-tree json -q '42*42' { "description": "const-folded expr", "iterator-tree": { "kind": "GenericArithIterator_MultiplyOperation", "id": "0x1cf4550", "iterators": [ { "kind": "SingletonIterator", "value": "xs:integer(42)", "id": "0x1cf3680" }, { "kind": "SingletonIterator", "value": "xs:integer(42)", "id": "0x1cf4500" } ] } } { "description": "main query", "iterator-tree": { "kind": "SingletonIterator", "value": "xs:integer(1764)", "id": "0x1ce6610" } }

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/28msec/zorba/issues/43#issuecomment-49177130.

MatthiasBrantner commented 10 years ago

I agree that it makes the plan hard to read. Let’s hide it for now but for debugging purposes an option is needed that allows you to see every detail of the plan.

On Jul 16, 2014, at 8:26 AM, Federico Cavalieri notifications@github.com wrote:

I think the trace becomes unreadable, especially for real queries, no? Also what is the semantic of plan, if we print multiple time the same thing in different states? Can you try to convince me that it is correct?

On Wed, Jul 16, 2014 at 4:53 PM, MatthiasBrantner notifications@github.com wrote:

I don’t think that’s a bug. What is shown here is the expression that was constant folded and resulted in the singleton iterator.

On Jul 16, 2014, at 7:30 AM, Federico Cavalieri notifications@github.com wrote:

vagrant@sausalito-devel-2-4-0:~/sausalito/build$ zorba/bin/zorba --iterator-tree json -q '42*42' { "description": "const-folded expr", "iterator-tree": { "kind": "GenericArithIterator_MultiplyOperation", "id": "0x1cf4550", "iterators": [ { "kind": "SingletonIterator", "value": "xs:integer(42)", "id": "0x1cf3680" }, { "kind": "SingletonIterator", "value": "xs:integer(42)", "id": "0x1cf4500" } ] } } { "description": "main query", "iterator-tree": { "kind": "SingletonIterator", "value": "xs:integer(1764)", "id": "0x1ce6610" } }

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/28msec/zorba/issues/43#issuecomment-49177130.

— Reply to this email directly or view it on GitHub.