Sequential scan vs Index
Posted in 1994
Topics: Performance & Tuning, Clustering, Grid & MACH11
Informix seems to forget his own indices and use sequential searches.
Here is a sqexplain.out for a special search:
QUERY:
------
select unique patient.* from stationaer, patient
where stationaer.izahl = patient.izahl
and stationaer.station = ?
and stationaer.e_datum >= ?
and stationaer.a_datum <= ?
order by 2, 4
Estimated Cost: 91
Estimated # of Rows Returned: 1
Temporary Files Required For: Order By
1) db.patient: SEQUENTIAL SCAN
2) db.stationaer: INDEX PATH
Filters: (db.stationaer.station = 'M306'
AND (db.stationaer.e_datum >= '03/04/1994'
AND db.stationaer.a_datum <= '03/04/1994' ) )
(1) Index Keys: izahl
Lower Index Filter: db.stationaer.izahl = db.patient.izahl
The tables were as follows:
stationaer:
Column name Type
izahl char(10)
aufnr integer
station char(4)
a_grund char(1)
a_datum date
a_uhrzeit smallint
a_ueberw integer
e_grund char(1)
e_datum date
e_uhrzeit smallint
e_ueberw integer
Index name Owner Type Cluster Columns
stat_c1 db dupls No station
e_datum
ix296_1 db dupls No izahl
and patient:
Column name Type
izahl char(10)
.........
Index name Owner Type Cluster Columns
pn_iz db unique No izahl
.....
I cannot understand why Informix uses sequential scan for the
table patient.
Any Ideas??
Dieter
--
Dr. med. dipl.-math Dieter Becker Tel.: (0 / +49) 6841 - 16 3046
Medizinische Universitaets- und Poliklinik Fax.: (0 / +49) 6841 - 16 3369
Innere Medizin III
D - 66421 Homburg / Saar Email: becker@med-in.uni-sb.de