Subject | Re: [firebird-support] Firebird vs Postgres |
---|---|
Author | Richard Wesley |
Post date | 2007-01-08T17:23:14Z |
On Jan 8, 2007, at 01:24, Svein Erling Tysvaer wrote:
filtering (when indexing and even joins come into play) or for
aggregation (SUM(func(arg)). And such functions can be endlessly
stacked. So we would have to generate the indexes on the fly, and
they would only be useful in certain situations.
comes in handy.
________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html
> Do you use this in your WHERE clause and use the new Fb 2We allow users to define derived columns, which can be used both for
> functionality
> of expression indexes? To me, it seems more like some statement to use
> in the SELECT part (which doesn't use indexes anyway). And if you
> really
> use it in the where clause and have indexed func(arg), I would expect
> that changing
filtering (when indexing and even joins come into play) or for
aggregation (SUM(func(arg)). And such functions can be endlessly
stacked. So we would have to generate the indexes on the fly, and
they would only be useful in certain situations.
> WHERE (CASE WHEN arg is NULL THEN CAST(NULL AS result_type) ELSEThat is where Firebird's very nice "IS NOT DISTINCT FROM" operator
> func(arg)
> END) = <value or other expression>
>
> into
>
> WHERE (CASE WHEN arg is NULL THEN CAST(NULL AS result_type) ELSE
> func(arg)
> END) = <value or other expression> AND
> func(arg) = <value or other expression>
>
> would produce the same result and use the expression index (though I
> would of course expect NULL to not equal any record since NULL isn't
> even equal to NULL).
comes in handy.
________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html