Thread: Re: set command

Re: set command

From
Tom Lane
Date:
"gary.wolfe" <gary.wolfe@biosourcetechnologies.com> writes:
>     Are there any disadvantages to having KSQO='on' instead
> of the default value of "OFF"

Other than it being a kluge, you mean ;-) ?

Basically it rewrites queries with long strings of ORs into SELECT UNION
SELECT queries, which the optimizer can cope with a little better.
Unfortunately the semantics aren't really quite the same, since UNION
implies a DISTINCT pass over the output --- the UNION form will never
emit two identical rows, whereas the original query would have if there
were identical input rows.

I'm hoping to get rid of KSQO soon by upgrading the optimizer to
the point where it doesn't choke on big ORs.  In the meantime, though,
you really don't have much choice if your application requires queries
with lots of ORs.
        regards, tom lane