Icon View Incident Report

Minor Minor
Reported By: Tiago Ameller
Reported On: 5/24/2005
For: Version 4.20 Build 2
# 2054 Adding an AND TRUE Expression to a WHERE Clauses Forces Un-Optimized Result

AND TRUE added to a WHERE clause causes no optimization in query.

This query is optimized, very fast:

SELECT Articulo, Ejercicio, Concepto, AlmacenOri, AlmacenDes,Modo,
SUM(Unidades1) AS Unidades1, SUM(Unidades2) AS Unidades2,
SUM(Importe1) AS Importe1, SUM(Importe2) AS Importe2
FROM
"K:\SFCLIE\01027\DATA\EM000001\SFEAR041" WHERE  Articulo = '35093'
AND Concepto IN (000 , 001 , 002 , 003 , 013 , 014 , 015 , 016)
AND Ejercicio = 2005

-- AND True

GROUP BY Ejercicio

While if you uncomment the AND TRUE, query is not optimized and 100 
times slower



Resolution Resolution
Fixed Problem on 6/2/2005 in version 4.21 build 1


Products Affected Products Affected
DBISAM Additional Software and Utilities
DBISAM ODBC Client-Server
DBISAM ODBC Client-Server with Source
DBISAM ODBC Standard
DBISAM ODBC Standard with Source
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source

Image