LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-289] UDXs currently always return an estimated rowcount of 1 #583

Open dynamobi-build opened 12 years ago

dynamobi-build commented 12 years ago

[reporter="zfong", created="Wed, 1 Aug 2007 16:07:29 -0500 (GMT-05:00)"] The estimated rowcount for a UDX node in a query tree currently always returns the value 1. This can be a problem if that UDX result is joined with another table. Assuming the optimizer chooses to place the smaller join input on the RHS of a join, if the UDX always has an estimated row count of 1, the optimizer will choose to place the UDX call on the right hand side of the join, when it may be more optimal to put it on the left.

In order to return an appropriate rowcount, we need to add new syntax to let you specify that the expected rowcount for a UDX is some function of its input. E.g., you can specify that the UDX returns the rowcount of its first input.

Until we add that feature, a short-term solution may be to always return the rowcount of a UDX's input, provided the UDX only has a single input. However, that may not always be correct, as the UDX may filter some of the rows in its input.

dynamobi-build commented 12 years ago

[author="jvs", created="Sat, 22 Sep 2007 13:32:01 -0500 (GMT-05:00)"] Change 9903 by jvs@jvs.kotick.eigenbase on 2007/09/22 13:30:37

        FARRAGO: fix FRG-289; single-input UDX now passes through the
        rowcount of its input; multi-input UDX acts like UNION ALL

Affected files ...

... //open/lu/dev/farrago/src/org/eigenbase/rel/TableFunctionRelBase.java#7 edit
... //open/lu/dev/farrago/unitsql/expressions/udfInvocation.ref#28 edit
... //open/lu/dev/farrago/unitsql/expressions/udfInvocation.sql#20 edit

dynamobi-build commented 12 years ago

[author="jvs", created="Sat, 22 Sep 2007 13:39:48 -0500 (GMT-05:00)"] Leaving this open since I've only implemented the short-term solution. Linked to here from http://docs.eigenbase.org/FarragoUdx#Relational_Inputs.