Re: SET EXPLAIN question
Posted in 1994
At 09:32 PM 12/12/94 GMT, Chris Wegener wrote:
>--
>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, is a very relative thing, and should not be taken
too literal. ( this was Informix's explanation when I posed a similar
question....)
Also, in OnLine DSA 7.x, ROWID as it extists today, changes. Informix,
while in earlier docs allude that using ROWID is the best method, now
discourages its use, suggesting the use of 'key based' look ups. This
is largely due to the fact that ROWID is no longer a unique in fragmented
tables. While you can create a fragmented table with rowid, it becomes
an additional serial column added to the schema, which is then indexed.
Because of this, it would now be a key-based lookup.....so why carry
the overhead (additional serial, indexed field).
Jon
==================================================================
Jon Vemo Internet: jvemo@cyberspace.com
Bothell, WA USA
------------------------------------------------------------------
Watch out for road-kill on the information superhighway....SPLAT!!
==================================================================