EXPORT_STATISTICS
Generates statistics in XML format from data previously collected by ANALYZE_STATISTICS
. Before you export statistics, collect the latest data by calling ANALYZE_STATISTICS
.
Syntax
EXPORT_STATISTICS ('[ filename ]', '[[[database.]schema.]table]' [, 'column[,…]' )
Parameters
filename |
Specifies where to write the generated XML. If filename already exists, |
[database.]schema |
Specifies a schema, by default myschema.thisDbObject If you specify a database, it must be the current database. |
table |
Specifies the table on which to export projection statistics. If you supply an empty string, Vertica exports all statistics for the database. |
scope |
Specifies the target table as follows: [[database.]schema.]table If you specify a database, it must be the current database. |
column |
The name of a column in table, typically a predicate column. You can specify multiple comma-delimited columns. Vertica narrows the scope of exported statistics to the specified columns only. |
Privileges
Superuser
Restrictions
EXPORT_STATISTICS
does not export statistics for LONG data type columns.
Examples
The following statement exports statistics on the VMart example database to a file:
=> SELECT EXPORT_STATISTICS('/opt/vertica/examples/VMart_Schema/vmart_stats.xml'); EXPORT_STATISTICS ----------------------------------- Statistics exported successfully (1 row)
The next statement exports statistics on a single column (price) from a table named food:
=> SELECT EXPORT_STATISTICS('/opt/vertica/examples/VMart_Schema/price.xml', 'food.price'); EXPORT_STATISTICS ----------------------------------- Statistics exported successfully (1 row)