Home | Previous Page | Next Page   Purpose-Function Reference > Purpose-Function Syntax >

am_stats

The database server calls am_stats to process an UPDATE STATISTICS statement.

Syntax

mi_integer am_stats(MI_AM_TABLE_DESC *tableDesc,
   MI_AM_TSTATS_DESC *tstatsDesc);
tableDesc
points to the table descriptor.
tstatsDesc
points to the statistics descriptor.

Usage

To influence the am_stats sampling rate, an UPDATE STATISTICS statement might include an optional distribution-level keyword, low, medium, or high. If the UPDATE STISTISTICS statement does not include one of these keywords, the default low distribution level applies.

Adjust the sampling rate in your version of the am_stats purpose function according to the distribution-level keyword that the user specifies in the UPDATE STATISTICS statement. To determine which keyword—LOW, MEDIUM, or HIGH—an UPDATE STATISTICS statement specifies, call the mi_tab_update_stat_mode() function. For detailed information about the sampling rates that each keyword implies, refer to the description of UPDATE STATISTICS in the IBM Informix: Guide to SQL Syntax.

The am_stats purpose function calls the various VTI accessor functions that set values in the statistics descriptor for the database server. The database server places the statistics descriptor results in the systables and syscolumns, system catalog tables. The am_stats function can also save any additional values in a location that am_scancost can access, such as a file in the extspace or a table in sbspace.

Return Values

MI_OK indicates success. MI_ERROR indicates failure.

Related Topics

See the descriptions of:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]