Icon View Incident Report

Serious Serious
Reported By: Robert Perelegre
Reported On: 5/2/2014
For: Version 2.16 Build 2
# 4099 Query Optimizer Not Selecting the Least Cost When Determining How to Execute a WHERE Clause

I have a Speed Problem in a Query. The problem appears when I create de index idx_periode (in the field Periode) whith this index created the time to execute the query is 0,671 seconds, and without this index the time is 0,031 seconds.

I don't understand this difference of speed and I need this index because I search for Periode often.

SELECT 
Valor_lectura,Data_lectura,Lect_modificada,Data_modificada,Lect_baixa_contracte,Coef
FROM Ele_Lectures
WHERE Codi_comptador=2559 AND Mes_lectura=4 AND Any_lectura=2014 AND 
Tipus_lectura=1 AND Periode=2



Comments Comments
The problem was that the optimizer was internally using the wrong costs with certain combination of AND'ed expressions, and would end up executing multiple expressions using indexes when the optimal strategy would have been to do a straight-up row scan.


Resolution Resolution
Fixed Problem on 9/25/2014 in version 2.18 build 1


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB PHP Standard
ElevateDB PHP Standard with Source
ElevateDB PHP Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image