Subject | FB 2.1.1 LIKE via STARTING WITH using upper index |
---|---|
Author | intellekta |
Post date | 2009-02-12T11:28:07Z |
Hi,
In the firebird faq i read this
Q: Why doesn't LIKE 'A%' always behave the same as STARTING WITH 'A'?
A: This is a known problem in Firebird optimizer and has been fixed in
Firebird 2.1.
i use a table with a computed index:
-- CREATE INDEX IDX_M_UPNNAME ON M COMPUTED BY (UPPER (NNAME))
a)
SELECT * FROM M WHERE UPPER(NNAME) STARTING WITH UPPER('z')
-- PLAN (M INDEX (IDX_M_UPNNAME))
b)
SELECT * FROM M WHERE UPPER(NNAME) LIKE UPPER('z%')
-- PLAN (M NATURAL)
2.1.1 optimizer problem ?
Thanks in advance
Uwe
In the firebird faq i read this
Q: Why doesn't LIKE 'A%' always behave the same as STARTING WITH 'A'?
A: This is a known problem in Firebird optimizer and has been fixed in
Firebird 2.1.
i use a table with a computed index:
-- CREATE INDEX IDX_M_UPNNAME ON M COMPUTED BY (UPPER (NNAME))
a)
SELECT * FROM M WHERE UPPER(NNAME) STARTING WITH UPPER('z')
-- PLAN (M INDEX (IDX_M_UPNNAME))
b)
SELECT * FROM M WHERE UPPER(NNAME) LIKE UPPER('z%')
-- PLAN (M NATURAL)
2.1.1 optimizer problem ?
Thanks in advance
Uwe