btree unique keys
Posted in 2000
Topics: General Discussion
Question: How can a query SMI tables to find out how many unique keys exist
for an index including composite indices (all segments)?
Background:
1 - pertains to 7.3 Informix Dynamic Server
2 - I'm aware that sysindexes contains the field "nunique" - however this
represents the number of unique keys for only the first segment of a
composite index
3 - I don't want to pursue using output from "oncheck" since this would be
cumbersome
Purpose: To be able to identify highly duplicated index keys
Thanks for the help.
jparker@wescodist.com
You could use the database's catalog to derive a 'fuzzy' idea of duplicity in
your indexes.
With stats relatively current, sysindexes.leaves indicates the number of pages
used by the index. Compute the number of pages the index would take if it
were fully unique (systables.nrows, sysindexes.part(s)->syscolumn.colno,
syscolumns.collength and some...). The ratio could be a statistic you may
find use for.
Rudy
"Parker, J" wrote:
> Question: How can a query SMI tables to find out how many unique keys exist
> for an index including composite indices (all segments)?
>
> Background:
> 1 - pertains to 7.3 Informix Dynamic Server
> 2 - I'm aware that sysindexes contains the field "nunique" - however this
> represents the number of unique keys for only the first segment of a
> composite index
> 3 - I don't want to pursue using output from "oncheck" since this would be
> cumbersome
>
> Purpose: To be able to identify highly duplicated index keys
>
> Thanks for the help.
>
> jparker@wescodist.com