<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Statistics management functions</title>
    <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/</link>
    <description>Recent content in Statistics management functions on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: ANALYZE_EXTERNAL_ROW_COUNT</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-external-row-count/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-external-row-count/</guid>
      <description>
        
        
        &lt;p&gt;Calculates the exact number of rows in an external table. &lt;code&gt;ANALYZE_EXTERNAL_ROW_COUNT&lt;/code&gt; runs in the background.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

You cannot calculate row counts on external tables with
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/storage-functions/do-tm-task/#&#34;&gt;DO_TM_TASK&lt;/a&gt;&lt;/code&gt;.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ANALYZE_EXTERNAL_ROW_COUNT (&amp;#39;[[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table-name &lt;/span&gt;]&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table-name &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the name of the external table for which to calculate the exact row count. If you supply an empty string, OpenText™ Analytics Database calculates the exact number of rows for all external tables.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Any INSERT/UPDATE/DELETE privilege on the external table&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Calculate the exact row count for all external tables:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT ANALYZE_EXTERNAL_ROW_COUNT(&amp;#39;&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Calculate the exact row count for table &lt;code&gt;loader_rejects&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT ANALYZE_EXTERNAL_ROW_COUNT(&amp;#39;loader_rejects&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/collecting-db-statistics/#&#34;&gt;Collecting database statistics&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-external-row-count/#&#34;&gt;DROP_EXTERNAL_ROW_COUNT&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: ANALYZE_STATISTICS</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics/</guid>
      <description>
        
        
        &lt;p&gt;Collects and aggregates data samples and storage information from all nodes that store projections associated with the specified table. The function skips columns of &lt;a href=&#34;../../../../../en/sql-reference/data-types/complex-types/&#34;&gt;complex data types&lt;/a&gt;. You can set the scope of the collection at several levels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Database&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Table column&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By default, OpenText™ Analytics Database analyzes multiple columns in a single-query execution plan, depending on resource limits. This multi-column analysis reduces plan execution latency and speeds up analysis of relatively small tables with many columns.&lt;/p&gt;
&lt;p&gt;The database writes statistics to the database catalog. The query optimizer uses this collected data to create query plans. Without this data, the query optimizer assumes uniform distribution of data values and equal storage usage for all projections.&lt;/p&gt;
&lt;p&gt;You can cancel statistics collection with CTRL+C or by calling &lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/session-functions/interrupt-statement/&#34;&gt;INTERRUPT_STATEMENT&lt;/a&gt;&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;ANALYZE_STATISTICS is an alias of the function ANALYZE_HISTOGRAM, which is no longer documented.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ANALYZE_STATISTICS (&amp;#39;[[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt;]&amp;#39; [, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;&lt;span class=&#34;code-variable&#34;&gt;column-list&lt;/span&gt;&lt;/span&gt;&amp;#39; [, &lt;span class=&#34;code-variable&#34;&gt;percent&lt;/span&gt; ]]  )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;p&gt;0—Success&lt;/p&gt;
&lt;p&gt;If an error occurs, refer to 
&lt;code&gt;vertica.log&lt;/code&gt; for details.&lt;/p&gt;
&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;code&gt;].&lt;/code&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Table on which to collect data. If set to an empty string, the database collects statistics for all database tables and their projections. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;column-list&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Comma-delimited list of columns in &lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;, typically predicate columns. The database narrows the scope of the data collection to the specified columns. Columns of complex types are not supported.
&lt;p&gt;If you alter a table to add a column and populate its contents with either default or other values, call &lt;span class=&#34;sql&#34;&gt;ANALYZE_STATISTICS&lt;/span&gt; on this column to get the most current statistics.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;percent&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Percentage of data to read from disk (not the amount to analyze), a float between 0 and 100. The default value is 10.
&lt;p&gt;Analyzing a higher percentage takes proportionally longer to process, but produces a higher level of sampling accuracy.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Table: One of INSERT, DELETE, or UPDATE&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The database supports &lt;span class=&#34;sql&#34;&gt;ANALYZE_STATISTICS&lt;/span&gt; on &lt;a href=&#34;../../../../../en/admin/working-with-native-tables/creating-temporary-tables/#Global&#34;&gt;local and global temporary tables&lt;/a&gt;. In both cases, you can obtain statistics only on tables that are created with the option &lt;span class=&#34;sql&#34;&gt;&lt;a href=&#34;../../../../../en/admin/working-with-native-tables/creating-temporary-tables/#Data&#34;&gt;ON COMMIT PRESERVE ROWS&lt;/a&gt;&lt;/span&gt;. Otherwise, the database deletes table content when committing the current transaction, so no table data is available for analysis.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The database collects no statistics from the following projections:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Live aggregate and Top-K projections&lt;/li&gt;
&lt;li&gt;Projections that are defined to include a SQL function within an expression&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The database collects no statistics on columns of &lt;a href=&#34;../../../../../en/sql-reference/data-types/complex-types/array/#&#34;&gt;ARRAY&lt;/a&gt;, &lt;a href=&#34;../../../../../en/sql-reference/data-types/complex-types/set/#&#34;&gt;SET&lt;/a&gt;, or &lt;a href=&#34;../../../../../en/sql-reference/data-types/complex-types/row/#&#34;&gt;ROW&lt;/a&gt; types.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/admin/collecting-db-statistics/collecting-table-statistics/#&#34;&gt;Collecting table statistics&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics-partition/#&#34;&gt;ANALYZE_STATISTICS_PARTITION&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: ANALYZE_STATISTICS_PARTITION</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics-partition/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics-partition/</guid>
      <description>
        
        
        &lt;p&gt;Collects and aggregates data samples and storage information for a range of partitions in the specified table. OpenText™ Analytics Database writes the collected statistics to the database catalog.&lt;/p&gt;
&lt;p&gt;You can cancel statistics collection with CTRL+C or meta-function &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/session-functions/interrupt-statement/&#34;&gt;INTERRUPT_STATEMENT&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ANALYZE_STATISTICS_PARTITION (&amp;#39;[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt;&amp;#39;, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;min-range-value&lt;/span&gt;&amp;#39;,&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;max-range-value&lt;/span&gt;&amp;#39; [, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;column-list&lt;/span&gt;&amp;#39; [, &lt;span class=&#34;code-variable&#34;&gt;percent&lt;/span&gt; ]] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;p&gt;0: Success&lt;/p&gt;
&lt;p&gt;If an error occurs, refer to 
&lt;code&gt;vertica.log&lt;/code&gt; for details.&lt;/p&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Table on which to collect data.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Minimum and maximum value of partition keys to analyze, where &lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt; must be ≤ &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;. To analyze one partition, &lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt; must be equal.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;column-list&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Comma-delimited list of columns in &lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;, typically a predicate column. The database narrows the scope of the data collection to the specified columns.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;percent&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Float value between 0 and 100 that specifies what percentage of data to read from disk (not the amount of data to analyze). If you omit this argument, the database sets the percentage to 10.
&lt;p&gt;Analyzing more than 10 percent disk space takes proportionally longer to process, but produces a higher level of sampling accuracy.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Table: One of INSERT, DELETE, or UPDATE&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;requirements-and-restrictions&#34;&gt;Requirements and restrictions&lt;/h2&gt;
&lt;p&gt;The following requirements and restrictions apply to ANALYZE_STATISTICS_PARTITION:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The table must be partitioned and cannot contain unpartitioned data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The table partition expression must specify a single column. The following expressions are supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Expressions that specify only the column—that is, partition on all column values. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PARTITION BY ship_date GROUP BY CALENDAR_HIERARCHY_DAY(ship_date, 2, 2)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the column is a &lt;a href=&#34;../../../../../en/sql-reference/data-types/datetime-data-types/date/#&#34;&gt;DATE&lt;/a&gt; or &lt;a href=&#34;../../../../../en/sql-reference/data-types/datetime-data-types/timestamptimestamptz/#&#34;&gt;TIMESTAMP/TIMESTAMPTZ&lt;/a&gt;, the partition expression can specify a &lt;a href=&#34;../../../../../en/admin/collecting-db-statistics/collecting-partition-statistics/#Supporte&#34;&gt;supported date/time function&lt;/a&gt; that returns that column or any portion of it, such as month or year. For example, the following partition expression specifies to partition on the year portion of column &lt;code&gt;order_date&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PARTITION BY YEAR(order_date)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Expressions that perform addition or subtraction on the column. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PARTITION BY YEAR(order_date) -1
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The table partition expression cannot coerce the specified column to another data type.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vertica collects no statistics from the following projections:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Live aggregate and Top-K projections&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Projections that are defined to include an SQL function within an expression&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/admin/collecting-db-statistics/collecting-partition-statistics/#&#34;&gt;Collecting partition statistics&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DROP_EXTERNAL_ROW_COUNT</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-external-row-count/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-external-row-count/</guid>
      <description>
        
        
        &lt;p&gt;Removes external table row count statistics compiled by 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-external-row-count/#&#34;&gt;ANALYZE_EXTERNAL_ROW_COUNT&lt;/a&gt;&lt;/code&gt;. &lt;code&gt;DROP_EXTERNAL_ROW_COUNT&lt;/code&gt; runs in the background.

&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;

Statistics can be time consuming to regenerate.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DROP_EXTERNAL_ROW_COUNT (&amp;#39;[[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table-name&lt;/span&gt; ]&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table-name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The external table for which to remove the exact row count. If you specify an empty string, OpenText™ Analytics Database drops the exact row count statistic for all external tables.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;INSERT/UPDATE/DELETE privilege on table&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privilege on schema that contains the table&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Drop row count statistics for external table &lt;code&gt;loader_rejects&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT DROP_EXTERNAL_ROW_COUNT(&amp;#39;loader_rejects&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/admin/collecting-db-statistics/#&#34;&gt;Collecting database statistics&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DROP_STATISTICS</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-statistics/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-statistics/</guid>
      <description>
        
        
        &lt;p&gt;Removes statistical data on database projections previously generated by 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics/#&#34;&gt;ANALYZE_STATISTICS&lt;/a&gt;&lt;/code&gt;. When you drop this data, the optimizer creates query plans using default statistics.

&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;

Regenerating statistics can incur significant overhead.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DROP_STATISTICS (&amp;#39;[[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt;]&amp;#39; [, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;category&lt;/span&gt;&amp;#39; [, &amp;#39;[&lt;span class=&#34;code-variable&#34;&gt;column-list&lt;/span&gt;]&amp;#39;] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Table on which to drop statistics. If set to an empty string, OpenText™ Analytics Database drops statistics for all database tables and their projections.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;category&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Category of statistics to drop, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ALL&lt;/code&gt; (default): Drop all statistics, including histograms and row counts.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;HISTOGRAMS&lt;/code&gt;: Drop only histograms. Row count statistics remain.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;column-list &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Comma-delimited list of columns in &lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;, typically predicate columns. The database narrows the scope of dropped statistics to the specified columns. If you omit this parameter or supply an empty string, the database drops statistics on all columns.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Table: One of INSERT, DELETE, or UPDATE&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Drop all base statistics for the table &lt;code&gt;store.store_sales_fact&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT DROP_STATISTICS(&amp;#39;store.store_sales_fact&amp;#39;);
 DROP_STATISTICS
-----------------
               0
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Drop statistics for all table projections:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT DROP_STATISTICS (&amp;#39;&amp;#39;);
 DROP_STATISTICS
-----------------
               0
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;

&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-statistics-partition/#&#34;&gt;DROP_STATISTICS_PARTITION&lt;/a&gt;&lt;/code&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DROP_STATISTICS_PARTITION</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-statistics-partition/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-statistics-partition/</guid>
      <description>
        
        
        &lt;p&gt;Removes statistical data on database projections previously generated by 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics-partition/#&#34;&gt;ANALYZE_STATISTICS_PARTITION&lt;/a&gt;&lt;/code&gt;. When you drop this data, the optimizer creates query plans using table-level statistics, if available, or default statistics.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DROP_STATISTICS_PARTITION (&amp;#39;[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt;&amp;#39;, &amp;#39;[&lt;span class=&#34;code-variable&#34;&gt;min-range-value&lt;/span&gt;]&amp;#39;, &amp;#39;[&lt;span class=&#34;code-variable&#34;&gt;max-range-value&lt;/span&gt;]&amp;#39; [, &lt;span class=&#34;code-variable&#34;&gt;category&lt;/span&gt; [, &amp;#39;[&lt;span class=&#34;code-variable&#34;&gt;column-list&lt;/span&gt;]&amp;#39;] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Table on which to drop statistics.&lt;/dd&gt;
&lt;dt&gt;
&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;min-range-value&lt;/span&gt; &lt;span class=&#34;code-variable&#34;&gt;max-range-value&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The minimum and maximum value of partition keys on which to drop statistics, where &lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt; must be ≤ &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;. If you supply empty strings for both parameters, OpenText™ Analytics Database drops all partition-level statistics for this table or the specified columns.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
The range of keys to drop must be equal to, or a superset of, the full range of partitions previously analyzed by &lt;code&gt;ANALYZE_STATISTICS_PARTITION&lt;/code&gt;. If the range omits any analyzed partition, &lt;code&gt;DROP_STATISTICS_PARTITION&lt;/code&gt; drops no statistics.
&lt;/div&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;category &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The category of statistics to drop, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;BASE&lt;/code&gt; (default): Drop histograms and row counts (min/max column values, histogram).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;HISTOGRAMS&lt;/code&gt;: Drop only histograms. Row count statistics remain.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ALL&lt;/code&gt;: Drop all statistics.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;column-list &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A comma-delimited list of columns in &lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;, typically predicate columns. The database narrows the scope of dropped statistics to the specified columns. If you omit this parameter or supply an empty string, the database drops statistics on all columns.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Schema: USAGE&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Table: One of INSERT, DELETE, or UPDATE&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;

&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-statistics/#&#34;&gt;DROP_STATISTICS&lt;/a&gt;&lt;/code&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EXPORT_STATISTICS</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics/</guid>
      <description>
        
        
        &lt;p&gt;Generates statistics in XML format from data previously collected by &lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics/#&#34;&gt;ANALYZE_STATISTICS&lt;/a&gt;. Before you export statistics, collect the latest data by calling &lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics/#&#34;&gt;ANALYZE_STATISTICS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;Stable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EXPORT_STATISTICS (&amp;#39;[ &lt;span class=&#34;code-variable&#34;&gt;filename&lt;/span&gt; ]&amp;#39; [,&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;table-spec&lt;/span&gt;&amp;#39; [,&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;column&lt;/span&gt;[,...]&amp;#39;]])
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies where to write the generated XML. If &lt;em&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/em&gt; already exists, EXPORT_STATISTICS overwrites it. If you supply an empty string, EXPORT_STATISTICS writes the XML to standard output.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table-spec&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the table on which to export projection statistics:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;  
[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;table
  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;p&gt;If &lt;em&gt;&lt;code&gt;table-spec&lt;/code&gt;&lt;/em&gt; is omitted or set to an empty string, OpenText™ Analytics Database exports all statistics for the database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;column &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The name of a column in &lt;em&gt;&lt;code&gt;table-spec&lt;/code&gt;&lt;/em&gt;, typically a predicate column. You can specify multiple comma-delimited columns. The database narrows the scope of exported statistics to the specified columns.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Superuser&lt;/p&gt;

&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;p&gt;EXPORT_STATISTICS does not export statistics for LONG data type columns.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following statement exports statistics on the VMart example database to a file:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT EXPORT_STATISTICS(&amp;#39;/opt/vertica/examples/VMart_Schema/vmart_stats.xml&amp;#39;);
        EXPORT_STATISTICS
-----------------------------------
Statistics exported successfully
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The next statement exports statistics on a single column (price) from a table named food:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT EXPORT_STATISTICS(&amp;#39;/opt/vertica/examples/VMart_Schema/price.xml&amp;#39;, &amp;#39;food.price&amp;#39;);
        EXPORT_STATISTICS
-----------------------------------
Statistics exported successfully
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics-partition/#&#34;&gt;EXPORT_STATISTICS_PARTITION&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/drop-statistics/#&#34;&gt;DROP_STATISTICS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/import-statistics/#&#34;&gt;IMPORT_STATISTICS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/validate-statistics/#&#34;&gt;VALIDATE_STATISTICS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/collecting-db-statistics/#&#34;&gt;Collecting database statistics&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/collecting-db-statistics/best-practices-statistics-collection/#&#34;&gt;Best practices for statistics collection&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EXPORT_STATISTICS_PARTITION</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics-partition/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics-partition/</guid>
      <description>
        
        
        &lt;p&gt;Generates partition-level statistics in XML format from data previously collected by &lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics-partition/#&#34;&gt;ANALYZE_STATISTICS_PARTITION&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;Stable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EXPORT_STATISTICS_PARTITION (&amp;#39;[ &lt;span class=&#34;code-variable&#34;&gt;filename&lt;/span&gt; ]&amp;#39;, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;table-spec&lt;/span&gt;&amp;#39;, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;min-range-value&lt;/span&gt;&amp;#39;,&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;max-range-value&lt;/span&gt;&amp;#39; [, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;column&lt;/span&gt;[,...]&amp;#39; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies where to write the generated XML. If &lt;em&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/em&gt; already exists, EXPORT_STATISTICS_PARTITION overwrites it. If you supply an empty string, the function writes to standard output.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table-spec&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the table on which to export partition statistics:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;  
[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;table
  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The minimum and maximum value of partition keys on which to export statistics, where &lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt; must be ≤ &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
The range of keys to export must be equal to, or a superset of, the full range of partitions previously analyzed by ANALYZE_STATISTICS_PARTITION. If the range omits any analyzed partition, EXPORT_STATISTICS_PARTITION exports no statistics.
&lt;/div&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;column &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The name of a column in &lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;, typically a predicate column. You can specify multiple comma-delimited columns. OpenText™ Analytics Database narrows the scope of exported statistics to the specified columns.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Superuser&lt;/p&gt;

&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;p&gt;EXPORT_STATISTICS_PARTITION does not export statistics for LONG data type columns.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics/#&#34;&gt;EXPORT_STATISTICS&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: IMPORT_STATISTICS</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/import-statistics/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/import-statistics/</guid>
      <description>
        
        
        &lt;p&gt;Imports statistics from the XML file that was generated by 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics/#&#34;&gt;EXPORT_STATISTICS&lt;/a&gt;&lt;/code&gt;. Imported statistics override existing statistics for the projections that are referenced in the XML file.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;Stable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;IMPORT_STATISTICS ( &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;filename&lt;/span&gt;&amp;#39; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;filename&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The path and name of an XML input file that was generated by 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics/#&#34;&gt;EXPORT_STATISTICS&lt;/a&gt;&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Superuser&lt;/p&gt;

&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;IMPORT_STATISTICS&lt;/code&gt; imports only valid statistics. If the source XML file has invalid statistics for a specific column, those statistics are not imported and OpenText™ Analytics Database displays a warning. If the statistics file has an invalid structure, the import operation fails. To check a statistics file for validity, run 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/validate-statistics/#&#34;&gt;VALIDATE_STATISTICS&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;IMPORT_STATISTICS&lt;/code&gt; returns warnings for LONG data type columns, as the source XML file generated by &lt;code&gt;EXPORT_STATISTICS&lt;/code&gt; contains no statistics for columns of that type.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Import the statistics for the VMart database from an XML file previously created by &lt;code&gt;EXPORT_STATISTICS&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT IMPORT_STATISTICS(&amp;#39;/opt/vertica/examples/VMart_Schema/vmart_stats.xml&amp;#39;);
                     IMPORT_STATISTICS
----------------------------------------------------------------------------
Importing statistics for projection date_dimension_super column date_key failure (stats did not contain row counts)
Importing statistics for projection date_dimension_super column date failure (stats did not contain row counts)
Importing statistics for projection date_dimension_super column full_date_description failure (stats did not contain row counts)
...
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics/#&#34;&gt;ANALYZE_STATISTICS&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics/#&#34;&gt;EXPORT_STATISTICS&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: VALIDATE_STATISTICS</title>
      <link>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/validate-statistics/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/validate-statistics/</guid>
      <description>
        
        
        &lt;p&gt;Validates statistics in the XML file generated by 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics/#&#34;&gt;EXPORT_STATISTICS&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;Stable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;VALIDATE_STATISTICS ( &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;XML-file&lt;/span&gt;&amp;#39; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;XML-file&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;the path and name of the XML file that contains the statistics to validate.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Superuser&lt;/p&gt;

&lt;h2 id=&#34;reporting-valid-statistics&#34;&gt;Reporting valid statistics&lt;/h2&gt;
&lt;p&gt;The following example shows the results when the statistics are valid:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT EXPORT_STATISTICS(&amp;#39;cust_dim_stats.xml&amp;#39;,&amp;#39;customer_dimension&amp;#39;);
    EXPORT_STATISTICS
-----------------------------------
 Statistics exported successfully
(1 row)

=&amp;gt; SELECT VALIDATE_STATISTICS(&amp;#39;cust_dim_stats.xml&amp;#39;);
 VALIDATE_STATISTICS
---------------------
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;identifying-invalid-statistics&#34;&gt;Identifying invalid statistics&lt;/h2&gt;
&lt;p&gt;If &lt;code&gt;VALIDATE_STATISTICS&lt;/code&gt; is unable to read a document&#39;s XML, it throws this error:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT VALIDATE_STATISTICS(&amp;#39;/home/dbadmin/stats.xml&amp;#39;);
                       VALIDATE_STATISTICS
----------------------------------------------------------------------------
Error validating statistics file: At line 1:1. Invalid document structure
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If some table statistics are invalid, &lt;code&gt;VALIDATE_STATISTICS&lt;/code&gt; returns a report that identifies them. In the following example, the function reports that attributes &lt;code&gt;distinct&lt;/code&gt;, &lt;code&gt;buckets&lt;/code&gt;, &lt;code&gt;rows&lt;/code&gt;, &lt;code&gt;count&lt;/code&gt;, and &lt;code&gt;distinctCount&lt;/code&gt; cannot be negative numbers.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT VALIDATE_STATISTICS(&amp;#39;/stats.xml&amp;#39;);
WARNING 0:  Invalid value &amp;#39;-1&amp;#39; for attribute &amp;#39;distinct&amp;#39; under column &amp;#39;public.t.x&amp;#39;.
   Please use a positive value.
WARNING 0:  Invalid value &amp;#39;-1&amp;#39; for attribute &amp;#39;buckets&amp;#39; under column &amp;#39;public.t.x&amp;#39;.
   Please use a positive value.
WARNING 0:  Invalid value &amp;#39;-1&amp;#39; for attribute &amp;#39;rows&amp;#39; under column &amp;#39;public.t.x&amp;#39;.
   Please use a positive value.
WARNING 0:  Invalid value &amp;#39;-1&amp;#39; for attribute &amp;#39;count&amp;#39; under bound &amp;#39;1&amp;#39;, column &amp;#39;public.t.x&amp;#39;.
   Please use a positive value.
WARNING 0:  Invalid value &amp;#39;-1&amp;#39; for attribute &amp;#39;distinctCount&amp;#39; under bound &amp;#39;1&amp;#39;, column &amp;#39;public.t.x&amp;#39;.
   Please use a positive value.
 VALIDATE_STATISTICS
---------------------
 (1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this case, run 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics/#&#34;&gt;ANALYZE_STATISTICS&lt;/a&gt;&lt;/code&gt; on the table again to create valid statistics.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/analyze-statistics/#&#34;&gt;ANALYZE_STATISTICS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/performance-analysis-functions/statistics-management-functions/export-statistics/#&#34;&gt;EXPORT_STATISTICS&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
  </channel>
</rss>
