Consultor Eletrônico



Kbase P19264: Complex WHERE clause kills the sql92 eng
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/11/2008
Status: Verified

SYMPTOM(s):

Complex WHERE clause kills the sql92 engine

FACT(s) (Environment):

Progress 9.1D
All Supported Operating Systems

CAUSE:

Bug# 20030127-015

FIX:

Upgrade to Progress 9.1D06.

If the upgrade is not possible, the following can be used as a workaround:

Query work and run better if the query ise re-written by adding an extra BETWEEN predicate. For example,

SELECT *
FROM PUB."bonif-prod"
WHERE ("fe-modif" > '01/01/1980' OR
("fe-modif" = '01/01/1980' AND "hh-modif" >0))
AND ("fe-modif" < '01/17/2003' OR
("fe-modif" = '01/17/2003' AND "hh-modif" <= 50941))
AND ("co-vendedor" = ' 5673')
AND "fe-modif" between '01/01/1980' and '01/17/2003' ;

The extra BETWEEN will help the sql optimizer figure out that the query can be answered by scanning the index between the 1980 and 2003 values, and then applying the other predicates as simple predicates.