23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UPDATE STATISTICS<br />

70<br />

UPDATE STATISTICS FOR Customer;<br />

The following example shows commands for table cardinality only:<br />

UPDATE TABLE STATISTICS FOR Customer;<br />

The following example shows commands for new index statistics:<br />

UPDATE INDEX STATISTICS FOR Customer;<br />

The following example shows commands for updating column statistics for index columns<br />

only:<br />

UPDATE COLUMN STATISTICS FOR Customer;<br />

The following example shows commands for updating statistics for all columns:<br />

UPDATE ALL COLUMN STATISTICS FOR Customer;<br />

The following example shows commands to obtain table cardinality and new index statistics<br />

and column statistics for all columns:<br />

UPDATE TABLE STATISTICS AND INDEX STATISTICS AND ALL COLUMN STATISTICS FOR<br />

Customer;<br />

Notes • All statistics are obtained online. Obtaining statistics does not require an exclusive lock on<br />

the schema or any table locks. Rows written to statistics tables will be exclusively locked,<br />

as in every transaction performing updates. Therefore, statistics can be obtained while<br />

normal database operations continue.<br />

• Specifying TABLE STATISTICS obtains table cardinality only. Table cardinalities are stored<br />

in the SYSTABLSTAT system catalog table.<br />

• Specifying INDEX STATISTICS obtains statistics on the number of unique values in each<br />

index. Index statistics are stored in the SYSIDXSTAT system catalog table.<br />

• Specifying COLUMN STATISTICS (without ALL) obtains statistics on the data distribution of<br />

values for each column that is an index key component.<br />

• Specifying ALL COLUMN STATISTICS obtains statistics on the data distribution of values for<br />

all columns.<br />

• The STATISTICS phrase can be repeated so that up to three statistics can be requested by a<br />

single UPDATE STATISTICS statement.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!