Re: Query Optimization question
Posted in 1997
On Thu, 10 Jul 1997, Ignatius Cristina Michelle wrote:
> Hi.
>
> What statistical information can Informix draw upon to determine how
> many rows will be satisified by a query coondition of the form "column =
> value", for example, "department = 'D'" where "department" may or may
> not be an "indexed" column. Where is this statistical information stored
> and what is the mechanism for keeping it up-to-date.
>
> Thankx in advance.
> Ignatius.
> iggycoco@pacbell.net
>
> P.S. If possible please copy me when posting a reply.
Christina,
Always one for the quick answer (but not too careful, my apologies) -
try putting this statement at the top of your sql,
set explain on;
Explain tells you how the optimizer is working tho' the stats are
somewhat misleading.
often misleading or meaningless. What you want to look at in the
explain.out file in your current directory is what indexes if any
optimizer is working on (Informix uses cost based optimization).
use
Before running your sql
update statistics for table mytable; Before running your sql, try -
update statistics for mytable;
update statistics for table mytable;
and does other appropriate things for the optimizer, depending on
the version you have.
And for the correct syntax, not me check the manual.
Hope this helps,
Nick
*********************************
Nick Nobbe, Library of Congress
NLS/BPH
mail: nnob@loc.gov
*********************************