Subject | Re: [firebird-support] Re: slow "where 1=0" |
---|---|
Author | unordained |
Post date | 2008-06-20T19:05:55Z |
> > Well, I sounds to me that he have to ... 1=0 if false in every place inWhich is really handy for
> > of the world <g>
>
> Constants against constants aren't checked, it's a silly query :-)
where ... (1=0 or xxx=yyy)
when you want to confuse the optimizer into not using an index on xxx; it doesn't know that "1 = 0"
= false, and that "false or x" = x. It would actually be annoying for firebird to suddenly become
smart about that -- it'd break a lot of hand-optimized queries out there (the merits of which can
still be debated.)
-Philip