Icon View Incident Report

Serious Serious
Reported By: Wolfgang Klein
Reported On: 2/19/2019
For: Version 2.30 Build 4
# 4728 SQL SELECT Statements with a Simple Indexed Condition Can Result in a Row Scan with High Row Count

Queries ares using an index only for small tables. I've tested a table with 91262 rows (it is using an index) and a table with
744571 rows (the a row scan is used). This doesn't look right to me.

================================================================================
SQL Query (Executed by ElevateDB 2.28 Build 3)

Note: The SQL  shown here is generated by ElevateDB and may not be exactly the same as the SQL that was originally entered.  However, none of the differences alter the execution results in any way.
================================================================================

SELECT ALL
"IDNR" AS "IDNR",
"AKIDNR" AS "AKIDNR",
"KBNR" AS "KBNR"
FROM "IWProben"
WHERE "AKIDNR" IS NULL

Source Tables
-------------

IWProben: 91262 rows

Result Set
----------

The result set was sensitive
The result set consisted of zero or more rows
The result set was ordered using the index PINDEX

Filtering
---------

The following filter condition was applied to the IWProben table:

"AKIDNR" IS NULL

Index scan (IWProben.AKIDNR): 91410 keys, 1,41MB estimated cost

================================================================================
91220 row(s) returned in 0,016 secs
================================================================================


================================================================================
SQL Query (Executed by ElevateDB 2.28 Build 3)

Note: The SQL  shown here is generated by ElevateDB and may not be exactly the same as the SQL that was originally entered.  However, none of the differences alter the execution results in any way.
================================================================================

SELECT ALL
"IDNR" AS "IDNR",
"AKIDNR" AS "AKIDNR"
FROM "IWProben"
WHERE "AKIDNR" IS NULL

Source Tables
-------------

IWProben: 744571 rows

Result Set
----------

The result set was sensitive
The result set consisted of zero or more rows
The result set was ordered using the index PINDEX

Filtering
---------

The following filter condition was applied to the IWProben table:

"AKIDNR" IS NULL

Row scan with one or more index scans eliminated due to cost (IWProben): 744571 rows, 596,47MB estimated cost

================================================================================
744571 row(s) returned in 1,139 secs
============================================================================



Comments Comments
The problem was with an arbitrary, internal threshhold ratio used to force an index scan in certain situations. Due to how the row counts are estimated for index scans, this threshhold was exceeded in some cases and would cause a row scan. In other words, this internal threshhold ratio needed to be set to a much higher value.


Resolution Resolution
Fixed Problem on 2/26/2019 in version 2.30 build 5


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