Re: Query Optimization question
Posted in 1997
Ignatius
In version 7.x (not in 5.x) you can do:
UPDATE STATISTICS MEDIUM FOR table(column) DISTRIBUTIONS ONLY
The MEDIUM will do data sampling whether or not you create an index on
the column. The DISTRIBUTIONS ONLY update the sysdistrib table in your
database.
In case you dont have distributions, the uniqueness of the column
will be determined by sysindexes.nunique / systables.nrows if you
have an index defined on the column.
A combination of the above statistics is what the Informix query opti-
mizer will use for determining the number of rows satisfied by your
query.
In version 5.x the only thing you can do is:
UPDATE STATISTICS [FOR table]
There is no sysdistrib table so distributions are not kept. The only
statistics the query optimizer can use are systables.nrows and
sysindexes.nunique if you have an index defined for the column.
HTH
Sujit Pal
>
> 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.
>