Start of Content Area

Procedure documentation Updating Statistics from the Command Line with SAPDBA  Locate the document in its SAP Library structure

Use

You can use SAPDBA for Informix from the operating system command line to perform update statistics. This gives you extra flexibility in specifying exactly how update statistics is performed and is useful for large tables when you want to customize SAPDBA.

Prerequisites

To perform update statistics in parallel, you might need to perform additional preparations:

For more information, see SAP Note 189399. When you have finished these preparations, you can use the parameters tabsparallel and colsparallel (see below). SAP intends to automate these preparations in future.

Procedure

Enter a command with the following syntax ( $ is the command line prompt):

$ sapdba-updstat

-threshold <n>

-level <high | medium>

-t <tabname>

-duration <min>

-check

-am

-nrowsl <low> -nrowsh <high>

-logfile <filepath>

-XXL

-systabs

-fc <n>

-forcedlow

-tabsparallel <n>

-colsparallel <n>

Parameters for update statistics from the command line:

Parameter

Explanation

-threshold <n>
(default: 10)

If set, this determines the percentage deviation between the statistics held by the optimizer for the number of rows in a table and the current (that is, correct) value. When the threshold is exceeded, update statistics is performed for the table. If the value is set to 0, all tables are updated. If not set, the default of 10% deviation is used.

-level <high | medium>
(default: medium)

If set, this determines the level of update statistics for non-heading index columns. If not set, non-heading index columns are updated at level medium.

-t <tabname>
(default: all tables)

If set, this restricts update statistics to a single specified table. If not set, all tables are updated.

-duration <min>

If set, this determines the maximum run-time for update statistics. If not set, the processing runs normally to completion.

-check

If set, no update statistics is run. Instead, each table is checked to see if update statistics is necessary. If so, an entry is made in the control table. If not set, a normal update statistics is run.

-am

If set, additional statistics are collected for the application monitor. However, this has a substantial performance overhead for update statistics. If you do not use the application monitor, do not set this parameter.

-nrowsl <low> -nrowsh <high>

If set, this determines the lower and upper limits for the number of rows in tables included in update statistics. For example:

-nrowsl 200 -nrowsh 10000

In this example, all tables having between 200 and 10 000 rows (inclusive) would be processed by update statistics.

-logfile <filepath>

If set, update statistics writes its log file to the <filepath> file. You can specify <filepath> in the following ways:

  • With a directory name, for example:

-logfile $INFORMIXDIR/dbatemp/updstat.log (UNIX)

-logfile %INFORMIXDIR%\dbatemp\updstat.log (NT)

  • Without a directory name, for example:

-logfile updstat.log

If you do not include a directory name, the file is written to the current directory.

The default log file from update statistics is called updstat<sid>.log and is stored in the default directory $INFORMIXDIR/sapreorg (UNIX) or %INFORMIXDIR%\sapreorg (NT). The log file is appended with information from the current run, until it reaches a size of 250 000 lines (approximately 10 MB). When it reaches this size, it is copied to updstat<sid>.old and a new file is started with the original name, updstat<sid>.log .

-XXL

If set, the logfile for update statistics contains extra information, useful for support purposes. You should not normally set this parameter.

- tabfile <filepath>

If set, update statistics processes only the tables listed in the <filepath> file. You can specify <filepath> in the following ways:

  • With a directory name, for example:

-tabfile $INFORMIXDIR/dbatemp/updstat.tab (UNIX)

-tabfile %INFORMIXDIR%\dbatemp\updstat.tab (NT)

  • Without a directory name, for example:

-tabfile updstat.tab

If you do not include a directory name, the file is read from the current directory, $INFORMIXDIR/sapreorg (UNIX) or %INFORMIXDIR%\sapreorg (NT).

-systabs

If set, update statistics is only performed on database system tables. This corresponds to Updating Statistics for All System Tables with SAPDBA, which you can start interactively from the menus in SAPDBA .

-fc <n>
(default: 1)

If set to a value greater than the default of 1, update statistics works with a different method. With a value of 2, for example, 2 fields are updated by each pass of the processing. You can set n to a value between 1 and 9. This brings a performance improvement for update statistics, but needs more sort space. Therefore, you should not set it for systems with large tables and a small amount of main storage space.

-forcedlow

If set, this causes an update statistics at level low for all tables in the current run of update statistics, regardless of what threshold you have set. This overrides the parameter threshold (see above in this section).

-tabsparallel <n>
(where 2 <= n <= 50)

If set, this causes update statistics to run in parallel at table level. SAPDBA starts n "child processes" to process n different tables, so giving you faster throughput. You must specify a value for n (there is no default). The value of the parameter NUMCPUVPS in the ONCONFIG file is a good value for n.

This option only makes sense for multiprocessor platforms and when more than one table is being updated. Therefore, you must not set the -t option when using this option.

-colsparallel <n> (where 2 <= n <= 50)

If set, this causes update statistics to run in parallel at column level. SAPDBA starts n "child processes" to process n different columns, so giving you faster throughput. You must specify a value for n (there is no default). The value of the parameter NUMCPUVPS in the ONCONFIG file is a good value for n.

This option only makes sense for multiprocessor platforms and when a single table is being updated. Therefore, you must also set the -t option when using this option.

Note

If you use parallel processing, the results are written by default to the following log files:

/$INFORMIXDIR/sapreorg/updstat_<SID>.<PID>

where <SID> is system ID and <PID> is child process ID, for example:

/informix/CX5/sapreorg/updstat_cx5.002

 

See also:

Informix documentation