SYS_DB_STAT
gathers common statistical information about the database.
SYS_DB_STAT
(in pcnt integer,
in ignore_vdb integer);
Description
The SYS_DB_STAT procedure gathers common
information about the whole Virtuoso database, including attached remote tables. It traverses
each table and populates the SYS_COL_STAT table with data collected. SYS_DB_STAT can
be used in random mode when not all rows of the tables are used to gather statistics
of the database.
SYS_DB_STAT gathers the following information
for each column, COL, traversed in the database:
- SYS_COL_STAT - SQL command
- CS_N_DISTINCT - count (distinct XXX)
- CS_MIN - min (XXX)
- CS_MAX - max (XXX)
- CS_AVG_LEN - avg (raw_length (XXX))
- CS_N_VALUES - count (XXX)
- CS_N_ROWS - count (XXX)
If remote tables are not ignored and random traversal is switched on
then SYS_DB_STAT reads the first 1000 rows and restores statistics by the first
1000 rows of table.
Parameters
pcnt –
Rate that affects percentage of database coverage. If it is less than 5
then this parameter is ignored. If pcnt more than 500 then SYS_DB_STAT acts
as if the parameter was equal to 500. There is no accurate conformity between
pcnt and percentage of databse coverage, but it is known that 5 usually means
10 percent of covarage and 500 means almost 100 percent.
ignore_vdb –
By default SYS_DB_STAT does not analyze the remote tables. To
allow statistics gathering over linked tables, set this parameter to zero.
Remote tables can be very large or access to them can be very slow or both.
If this parameter is set to zero and pcnt is zero, SYS_DB_STAT could take a lot of time.