Home

Contents
Preface

Virtuoso Functions Guide

Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote Data Source
Replication
SOAP
SQL
__any_grants
close
collation_define
complete_table_name
delay
end_result
exec
exec_next
exec_result
exec_result_names
identity_value
name_part
registry_get
registry_get_all
registry_name_is_pro...
registry_remove
registry_set
result
result_names
row_count
sequence_get_all
sequence_next
sequence_remove
sequence_set
set_identity_column
set_row_count
set_user_id
signal
sinv_create_inverse
sinv_create_key_mapp...
sinv_drop_inverse
sys_stat_analyze
sys_stat_histogram
table_drop_policy
table_set_policy
username
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY

Functions Index

sys_stat_analyze

Collects statistics on a table and its columns for use in SQL optinmization
sys_stat_analyze (in table_name varchar, [in pcnt integer], [in ignore_vdb integer]);
Description

This function collects (or updates) column statistics for the table columns. It collects minimum, maximum average and distinct values for a column and a row count for the table and inserts the data into the DB.DBA.SYS_COL_STAT table. It does not make historgrams for the columns.

The statistics are then used by the Optimized SQL compiler. All the cached compilations are discarded, because some of them may compile differently in the light of the new data.

This function will normally consider the entire database with the exception of remote tables. Since you may be concerned about time or remote tables this operation is configurable using the optional parameters, pcnt and ignore_vdb.

Parameters
table_name – The full name of the table exactly as in the KEY_TABLE column of SYS_KEYS.
pcnt – Determines how much of the database to gather statistics for. Legal values are 0, or between 5 - 500. Any non-zero value will gather information on a random subset of the database tables, the greater the value, the larger the subset.
ignore_vdb – Determines whether remote tables are considered. By default remote tables (ignore_vdb = 1) are ignored. Setting this value to 0 will cause this function to gather statistical information for remote tables also.
See Also

sys_stat_histogram

SYS_DB_STAT()