dynamobi/dynamobi — Issue #583: [FRG-289] UDXs currently always return an estimated rowcount of 1
Author: dynamobi-build
Created: 2011-12-30 03:36:58+00:00
State: open
Labels: FRG, UDF

[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.