Wednesday, March 19, 2014

TD 14 Statistics Enhancement

If we need to collect statistics for two or more single columns of a table then we can use the new feature, check out the below example:

OLD SYNTAX:

COLLECT STATS ON SYSDBA.EMPLOYEE COLUMN (EMP_NAME);
COLLECT STATS ON SYSDBA.EMPLOYEE COLUMN (EMP_Id);

NEW FEATURE:

COLLECT STATISTICS  COLUMN (EMP_NAME ), COLUMN (EMP_ID ) ON SYSDBA.EMPLOYEE;

Benefit:

Using the new feature the single column stats are segregated and stats are collected at a time.
Hence single statement can be used for collecting different single column  stats of a same table.

Performance wise the full table scan is performed only once because of the new syntax as all the required columns will be provided in a single statement.

No comments:

Post a Comment