Subject | Re: FB 1.5 vs. 2.0 optimizer difference |
---|---|
Author | emb_blaster |
Post date | 2009-04-22T17:44:10Z |
> Is this an intentional change in the optimizer? I do know the statementHi Paul,
> was very poorly written whenever it was first done. It just seems that
> FB 2.0 should be able to generate the same or better plan than 1.5. My
> concern is only that upgrading to FB 2.0 might expose some other
> 'newbie' SQL code in the application that was working fine, and now
> won't be.
>
> Paul
Some months ago we here also "upgraded" our DB from FB1.5 to FB2.0.
The only "problems" that we found are all in Release notes of FB2.0.
The *WORSE* was the same problem that you found.
Another error found is the way thatFB1.5 and FB2.0 see nulls.
Example:
let say
TableA(ID:Integer,vType:varchar(1))
with this data
(1,'A')
(2,'A')
(3,'C')
(4,null) //note that vType is null and not a string containing 'null'
the statment below
select * from TableA
where vType <> 'A';
will Result in FB1.5
(3,'C')
(4,null)
and in FB2.0 will result only
(3,'C')
Problably it was an intentional change, because of errors found in 1.5 like other posts said. But you also had found the way to correct.
So, search for any "... NOT IN (SELECT ..." in your DB and soft and change it to "...Not Exists.." and searche for this comparing querys.
This way i think you will not have nigthmares :D
WTH,