Icon View Incident Report

Minor Minor
Reported By: Harry de Boer
Reported On: 4/19/2007
For: Version 1.02 Build 1
# 2331 IN Operator Not Optimized Correctly if Indexes are Available

It seems that OR is using an index scan while IN is using a row scan for the same column.

select * from test
where veld1 in (200,2000)
================================================================================
SQL Query (Executed by ElevateDB 1.02 Build 1)

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
"test"."veld1" AS "veld1",
"test"."veld2" AS "veld2",
"test"."veld3" AS "veld3"
FROM "test"
WHERE "veld1" IN (200, 2000)

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

test: 1000002 rows

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

The result set was static
The result set consisted of zero or more rows

Filtering
---------

The following filter condition was applied to the test table:

"veld1" IN (200, 2000) [Row scan: 1000002 rows, 56000112 bytes estimated cost]

================================================================================
2 row(s) returned in 2,516 secs
================================================================================

select * from test
where veld1 = 200 or veld1 = 2000
================================================================================
SQL Query (Executed by ElevateDB 1.02 Build 1)

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
"test"."veld1" AS "veld1",
"test"."veld2" AS "veld2",
"test"."veld3" AS "veld3"
FROM "test"
WHERE "veld1" = 200 OR "veld1" = 2000

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

test: 1000002 rows

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

The result set was static
The result set consisted of zero or more rows

Filtering
---------

The following filter condition was applied to the test table:

"veld1" = 200 OR "veld1" = 2000 [Index scan: 1 keys, 4096 bytes estimated cost]

================================================================================
2 row(s) returned in 0 secs
================================================================================



Resolution Resolution
Fixed Problem on 4/22/2007 in version 1.03 build 1


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

Image