Subject | Re: [firebird-support] Re: Optimizing in (...) Statements |
---|---|
Author | Arno Brinkman |
Post date | 2004-10-14T12:30:08Z |
Hi,
Change :
where
vp_parentpos = :PARENT and
vp_delete != "T" and
vp_posart = 1 and
vo_delete != "T" and
((vo_status = "2" and vo_art = 2) or
(vo_status = "4" and vo_art = 2) or
(vo_status = "9" and vo_art = 2) or
(vo_status = "2" and vo_art = 3) or
(vo_status = "4" and vo_art = 3) or
(vo_status = "9" and vo_art = 3))
Why?
Because now it can use optimal the index on VO_ART, VO_STATUS
Let us know if this helps.
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info
Change :
> whereto :
> vp_parentpos = :PARENT and
> vp_delete != "T" and
> vp_posart = 1 and
> vo_delete != "T" and
> vo_status in ("2", "4", "9") and
> vo_art in (2, 3)
where
vp_parentpos = :PARENT and
vp_delete != "T" and
vp_posart = 1 and
vo_delete != "T" and
((vo_status = "2" and vo_art = 2) or
(vo_status = "4" and vo_art = 2) or
(vo_status = "9" and vo_art = 2) or
(vo_status = "2" and vo_art = 3) or
(vo_status = "4" and vo_art = 3) or
(vo_status = "9" and vo_art = 3))
Why?
Because now it can use optimal the index on VO_ART, VO_STATUS
Let us know if this helps.
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info