Icon View Incident Report

Minor Minor
Reported By: Jim Garrity
Reported On: 12/16/2008
For: Version 2.02 Build 5
# 2875 Queries Upon Non-Updateable Views Not Using Indexes for Optimization

I am using the following Sql, there are 2719 rows in the Patient table and 2477 in the Address table in my test DB.

The results of the query are 2457 rows in 31 secs. (local, not remote to you).

SELECT rptPatient.First_Name,
       rptPatientAddress.Mailing_Name
FROM rptPatient rptPatient
      LEFT OUTER JOIN rptPatientAddress rptPatientAddress ON
     (rptPatientAddress.Owner_ID = rptPatient.Entity_ID)
where rptPatientAddress.Mailing = true

rptPatient:

select Pat.*,
extract(month from Date_of_Birth) as Birth_Month,
EXTRACT(Year FROM Current_Date)- extract(Year from Date_of_Birth) as Age,
Staff.Abbreviation as Clinician_Name, 
Off.Abbreviation as Office_Name,
Prof.Abbreviation as Physician_Name
from Patient Pat
left outer join Staff on Pat.Clinician_ID = Staff.Entity_ID
left outer join Office Off on Pat.Office_ID = Office.Entity_ID
left outer join Professional Prof on Pat.Physician_ID = Prof.Entity_ID
where Removed = false

rptPatientAddress:

select A.*,
L.City, L.State_Code, L.Postal_Code
from Address A
left join Location L on A.Location_ID = L.Entity_ID
where Removed = false
and Owner_Type = 1



Comments Comments
Internally, insensitive result sets (which the views above are generating) will default to ordering their result set based upon the primary key of the first table in the FROM clause. This is ideal for most situations, and would have allowed the query upon the views to use these indexes for optimizing the join. However, EDB was not matching the indexed view result set columns properly during the index selection process, thus resulting in the join being completely un-optimized and very slow.


Resolution Resolution
Fixed Problem on 12/17/2008 in version 2.02 build 6


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 VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image