SET EXPLAIN question
Posted in 1994
--
When I was checking through the sqexplain.out for an application I am
converting to use Informix I noticed some unexpectedly high Estimated
Cost values on statements where I use ROWID in the WHERE clause.
For example:
QUERY:
------
SELECT TABLE_DESC , ASSOC_REC FROM MSF010 WHERE ROWID = ?
Estimated Cost: 1469
Estimated # of Rows Returned: 1
1) ats.msf010: INDEX PATH
(1) Index Keys: ROWID
Lower Index Filter: ats.msf010.ROWID = 194830
The manual tells me that using ROWID is 'the simplest form of
nonsequential access' and since the 'rowid value specifies the
physical location of the row and its page' I thought this would not
require anything other than a direct read with an Estimated Cost of 1.
The Estimated Cost appears constant for all accesses to a table and
varies according to the size of the table. The table ats.msf010
contains 15,883 records.
Is the value reported by SET EXPLAIN invalid or do I have cause to
worry?
Also, is there a recommended definition for a COBOL host variable that
will hold the ROWID value? And will the definition affect the
Estimated Cost in any way?
I am using Online V6.
Regards,
Chris
------------------------------------------------------------------------------
Chris Wegener Mincom Pty Ltd,
Database Consultant Wyandra Street, | | | | | |
chrispw@tenmail.mincom.oz.au Teneriffe, Brisbane, | | | | | |
Phone: +61 7 303 3333 X2288 Queensland, | | | | | |
Fax: +61 7 303 3232 Australia 4005 |M |I |N |C |O |M
------------------------------------------------------------------------------