Manually Setting Column Statistics: Example Using SET_COLUMN_STATS to Set LOW_VALUE and HIGH_VALUE of a Column Manually
(Doc ID 1276174.1)
Last updated on NOVEMBER 01, 2019
Applies to:
Oracle Database - Enterprise Edition - Version 9.0.1.0 and laterOracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.
Goal
In some cases, it may be necessary to set some column statistics manually in order to allow the optimizer to make correct plan decisions.
For example, some circumstances we might want to do this could be:
- when it takes too long to gather all the statistics for a big table
- when we want to help the optimizer to choose a specific execution plan based on some specific statistics
Since the procedure to set LOW_VALUE and HIGH_VALUE is quite long, this example explains how to set LOW_VALUE and HIGH_VALUE of a column manually for data types NUMBER, CHAR, DATE.
Solution
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Goal |
Solution |
Create and populate the table gathering statistics |
Examples showing setting of each column to different values: |
Check the modified values: |