VALIDATE_STATISTICS
Validates statistics in the XML file generated by the EXPORT_STATISTICS command.
Syntax
VALIDATE_STATISTICS ( 'XML_statistics_file' )
Parameters
XML_statistics_file |
Specifies the path and name of the XML file that contains the statistics you want to validate, type VARCHAR. |
Privileges
Superuser
Usage Considerations
-
IMPORT_STATISTICS imports only valid statistics. If the source file has invalid statistics for a specific column, those statistics are not imported and a warning occurs. To identify the invalid statistics, run VALIDATE_STATISTICS.
Example: Valid Statistics
The following example shows the results when the statistics are valid:
=> SELECT EXPORT_STATISTICS('cust_dim_stats.xml','customer_dimension');
EXPORT_STATISTICS
-----------------------------------
Statistics exported successfully
(1 row)
=> SELECT VALIDATE_STATISTICS('cust_dim_stats.xml');
VALIDATE_STATISTICS
---------------------
(1 row)
Example: Invalid Statistics File
The following example shows the results when some of the statistics are invalid. For example, the 'distinct', 'buckets', 'rows', 'count', and 'distinctCount' attributes cannot be negative numbers. Vertica recommends that you rerun ANALYZE_STATISTICS on this table to create valid statistics:
=> SELECT VALIDATE_STATISTICS('/stats.xml');
WARNING 0: Invalid value '-1' for attribute 'distinct' under column 'public.t.x'.
Please use a positive value.
WARNING 0: Invalid value '-1' for attribute 'buckets' under column 'public.t.x'.
Please use a positive value.
WARNING 0: Invalid value '-1' for attribute 'rows' under column 'public.t.x'.
Please use a positive value.
WARNING 0: Invalid value '-1' for attribute 'count' under bound '1', column 'public.t.x'.
Please use a positive value.
WARNING 0: Invalid value '-1' for attribute 'distinctCount' under bound '1', column 'public.t.x'.
Please use a positive value.
VALIDATE_STATISTICS---------------------
(1 row)
Example: Invalid Statistics File
The following example shows the result when the statistics file is invalid:
=> SELECT VALIDATE_STATISTICS('/home/dbadmin/stats.xml');
VALIDATE_STATISTICS
----------------------------------------------------------------------------
Error validating statistics file: At line 1:1. Invalid document structure
(1 row)