<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Managing partitions</title>
    <link>/en/admin/partitioning-tables/managing-partitions/</link>
    <description>Recent content in Managing partitions on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/admin/partitioning-tables/managing-partitions/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Admin: Dropping partitions</title>
      <link>/en/admin/partitioning-tables/managing-partitions/dropping-partitions/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/partitioning-tables/managing-partitions/dropping-partitions/</guid>
      <description>
        
        
        &lt;p&gt;Use the &lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/partition-functions/drop-partitions/#&#34;&gt;DROP_PARTITIONS&lt;/a&gt; function to drop one or more partition keys for a given table. You can specify a single partition key or a range of partition keys.&lt;/p&gt;
&lt;p&gt;For example, the table shown in &lt;a href=&#34;../../../../en/admin/partitioning-tables/defining-partitions/partitioning-new-table/#&#34;&gt;Partitioning a new table&lt;/a&gt; is partitioned by column &lt;code&gt;order_date&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE public.store_orders
(
    order_no int,
    order_date timestamp NOT NULL,
    shipper varchar(20),
    ship_date date
)
PARTITION BY YEAR(order_date);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Given this table definition, OpenText™ Analytics Database creates a partition key for each unique &lt;code&gt;order_date&lt;/code&gt; year—in this case, 2017, 2016, 2015, and 2014—and divides the data into separate ROS containers accordingly.&lt;/p&gt;
&lt;p&gt;The following DROP_PARTITIONS statement drops from table &lt;code&gt;store_orders&lt;/code&gt; all order records associated with partition key 2014:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT DROP_PARTITIONS (&amp;#39;store_orders&amp;#39;, 2014, 2014);
Partition dropped
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a name=&#34;Splittin&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;splitting-partition-groups&#34;&gt;Splitting partition groups&lt;/h2&gt;
&lt;p&gt;If a table partition clause includes a GROUP BY clause, partitions are consolidated in the ROS by their partition group keys. DROP_PARTITIONS can then specify a range of partition keys within a given partition group, or across multiple partition groups. In either case, the drop operation requires the database to split the ROS containers that store these partitions. To do so, the function&#39;s &lt;code&gt;force_split&lt;/code&gt; parameter must be set to true.&lt;/p&gt;
&lt;p&gt;For example, the &lt;code&gt;store_orders&lt;/code&gt; table shown above can be repartitioned with a GROUP BY clause as follows:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER TABLE store_orders
     PARTITION BY order_date::DATE GROUP BY DATE_TRUNC(&amp;#39;year&amp;#39;, (order_date)::DATE) REORGANIZE;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With all 2014 order records having been dropped earlier, &lt;code&gt;order_date&lt;/code&gt; values now span three years—2017, 2016, and 2015. Accordingly, the Tuple Mover creates three partition group keys for each year, and designates one or more ROS containers for each group. It then merges &lt;code&gt;store_orders&lt;/code&gt; partitions into the appropriate groups.&lt;/p&gt;
&lt;p&gt;The following DROP_PARTITIONS statement specifies to drop order dates that span two years, 2014 and 2015:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT DROP_PARTITIONS(&amp;#39;store_orders&amp;#39;, &amp;#39;2015-05-30&amp;#39;, &amp;#39;2016-01-16&amp;#39;, &amp;#39;true&amp;#39;);
Partition dropped
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The drop operation requires the database to drop partitions from two partition groups—2015 and 2016. These groups span at least two ROS containers, which must be split in order to remove the target partitions. Accordingly, the function&#39;s &lt;code&gt;force_split&lt;/code&gt; parameter is set to true.&lt;/p&gt;
&lt;h2 id=&#34;scheduling-partition-drops&#34;&gt;Scheduling partition drops&lt;/h2&gt;
&lt;p&gt;If your hardware has fixed disk space, you might need to configure a regular process to roll out old data by dropping partitions.&lt;/p&gt;
&lt;p&gt;For example, if you have only enough space to store data for a fixed number of days, configure the database to drop the oldest partition keys. To do so, create a time-based job scheduler such as &lt;code&gt;cron&lt;/code&gt; to schedule dropping the partition keys during low-load periods.&lt;/p&gt;
&lt;p&gt;If the ingest rate for data has peaks and valleys, you can use two techniques to manage how you drop partition keys:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up a process to check the disk space on a regular (daily) basis. If the percentage of used disk space exceeds a certain threshold—for example, 80%—drop the oldest partition keys.&lt;/li&gt;
&lt;li&gt;Add an artificial column in a partition that increments based on a metric like row count. For example, that column might increment each time the row count increases by 100 rows. Set up a process that queries this column on a regular (daily) basis. If the value in the new column exceeds a certain threshold—for example, 100—drop the oldest partition keys, and set the column value back to 0.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;table-locking&#34;&gt;Table locking&lt;/h2&gt;
&lt;p&gt;DROP_PARTITIONS requires an exclusive &lt;a href=&#34;../../../../en/admin/db-locks/lock-modes/#Drop_Partition&#34;&gt;D lock&lt;/a&gt; on the target table. This lock is only compatible with I-lock operations, so only table load operations such as INSERT and COPY are allowed during drop partition operations.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Archiving partitions</title>
      <link>/en/admin/partitioning-tables/managing-partitions/archiving-partitions/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/partitioning-tables/managing-partitions/archiving-partitions/</guid>
      <description>
        
        
        &lt;p&gt;You can move partitions from one table to another with the function 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/partition-functions/move-partitions-to-table/#&#34;&gt;MOVE_PARTITIONS_TO_TABLE&lt;/a&gt;&lt;/code&gt;. This function is useful for archiving old partitions, as part of the following procedure:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Identify the partitions to archive, and &lt;a href=&#34;#MovePartitions&#34;&gt;move them to a temporary staging table&lt;/a&gt; with 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/partition-functions/move-partitions-to-table/#&#34;&gt;MOVE_PARTITIONS_TO_TABLE&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#BackUpTempTables&#34;&gt;Back up the staging table&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#DropTempTables&#34;&gt;Drop the staging table&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You &lt;a href=&#34;#RestoringArchivedPartitions&#34;&gt;restore archived partitions&lt;/a&gt; at any time.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;MovePartitions&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;move-partitions-to-staging-tables&#34;&gt;Move partitions to staging tables&lt;/h2&gt;
&lt;p&gt;You archive historical data by identifying the partitions you wish to remove from a table. You then move each partition (or group of partitions) to a temporary staging table.&lt;/p&gt;
&lt;p&gt;Before calling &lt;code&gt;MOVE_PARTITIONS_TO_TABLE&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Refresh all out-of-date projections.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following recommendations apply to staging tables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To facilitate the backup process, create a unique schema for the staging table of each archiving operation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify new names for staging tables. This ensures that they do not contain partitions from previous move operations.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;If the table does not exist, Vertica creates a table from the source table&#39;s definition, by calling 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/statements/create-statements/create-table/#&#34;&gt;CREATE TABLE&lt;/a&gt;&lt;/code&gt; with &lt;code&gt;LIKE&lt;/code&gt; and &lt;code&gt;INCLUDING PROJECTIONS&lt;/code&gt; clause. The new table inherits ownership from the source table. For details, see &lt;a href=&#34;../../../../en/admin/working-with-native-tables/creating-table-from-other-tables/replicating-table/#&#34;&gt;Replicating a table&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use staging names that enable other users to easily identify partition contents. For example, if a table is partitioned by dates, use a name that specifies a date or date range.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the following example, &lt;code&gt;MOVE_PARTITIONS_TO_TABLE&lt;/code&gt; specifies to move a single partition to the staging table &lt;code&gt;partn_backup.tradfes_200801&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MOVE_PARTITIONS_TO_TABLE (
          &amp;#39;prod_trades&amp;#39;,
          &amp;#39;200801&amp;#39;,
          &amp;#39;200801&amp;#39;,
          &amp;#39;partn_backup.trades_200801&amp;#39;);
MOVE_PARTITIONS_TO_TABLE
-------------------------------------------------
 1 distinct partition values moved at epoch 15.
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a name=&#34;BackUpTempTables&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;back-up-the-staging-table&#34;&gt;Back up the staging table&lt;/h2&gt;
&lt;p&gt;After you create a staging table, you archive it through an object-level backup using a 
&lt;code&gt;vbr&lt;/code&gt; configuration file. For detailed information, see &lt;a href=&#34;../../../../en/admin/backup-and-restore/#&#34;&gt;Backing up and restoring the database&lt;/a&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;
It is recommended to perform a full database backup before the object-level backup, as a precaution against data loss. You can only restore object-level backups to the original database.
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;DropTempTables&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;drop-the-staging-tables&#34;&gt;Drop the staging tables&lt;/h2&gt;
&lt;p&gt;After the backup is complete, you can drop the staging table as described in &lt;a href=&#34;../../../../en/admin/working-with-native-tables/dropping-tables/#&#34;&gt;Dropping tables&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;RestoringArchivedPartitions&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;restoring-archived-partitions&#34;&gt;Restoring archived partitions&lt;/h2&gt;
&lt;p&gt;You can restore partitions that you previously moved to an intermediate table, archived as an object-level backup, and then dropped.

&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;

Restoring an archived partition requires that the original table definition is unchanged since the partition was archived and dropped. If the table definition changed, you can restore an archived partition with INSERT...SELECT statements, which are not described here.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;These are the steps to restoring archived partitions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Restore the backup of the intermediate table you saved when you moved one or more partitions to archive (see &lt;a href=&#34;../../../../en/admin/partitioning-tables/managing-partitions/archiving-partitions/#&#34;&gt;Archiving partitions&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Move the restored partitions from the intermediate table to the original table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Drop the intermediate table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Swapping partitions</title>
      <link>/en/admin/partitioning-tables/managing-partitions/swapping-partitions/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/partitioning-tables/managing-partitions/swapping-partitions/</guid>
      <description>
        
        
        &lt;p&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/partition-functions/swap-partitions-between-tables/#&#34;&gt;SWAP_PARTITIONS_BETWEEN_TABLES&lt;/a&gt; combines the operations of &lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/partition-functions/drop-partitions/#&#34;&gt;DROP_PARTITIONS&lt;/a&gt; and &lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/partition-functions/move-partitions-to-table/#&#34;&gt;MOVE_PARTITIONS_TO_TABLE&lt;/a&gt; as a single transaction. SWAP_PARTITIONS_BETWEEN_TABLES is useful if you regularly load partitioned data from one table into another and need to refresh partitions in the second table.&lt;/p&gt;
&lt;p&gt;For example, you might have a table of revenue that is partitioned by date, and you routinely move data into it from a staging table. Occasionally, the staging table contains data for dates that are already in the target table. In this case, you must first remove partitions from the target table for those dates, then replace them with the corresponding partitions from the staging table. You can accomplish both tasks with a single call to SWAP_PARTITIONS_BETWEEN_TABLES.&lt;/p&gt;
&lt;p&gt;By wrapping the drop and move operations within a single transaction, SWAP_PARTITIONS_BETWEEN_TABLES maintains integrity of the swapped data. If any task in the swap operation fails, the entire operation fails and is rolled back.&lt;/p&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;The following example creates two partitioned tables and then swaps certain partitions between them.&lt;/p&gt;
&lt;p&gt;Both tables have the same definition and have partitions for various &lt;code&gt;year&lt;/code&gt; values. You swap the partitions where &lt;code&gt;year&lt;/code&gt; = 2008 and &lt;code&gt;year&lt;/code&gt; = 2009. Both tables have at least two rows to swap.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create the &lt;code&gt;customer_info&lt;/code&gt; table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE customer_info (
      customer_id INT NOT NULL,
      first_name VARCHAR(25),
      last_name VARCHAR(35),
      city VARCHAR(25),
      year INT NOT NULL)
      ORDER BY last_name
      PARTITION BY year;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Insert data into the &lt;code&gt;customer_info&lt;/code&gt; table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INSERT INTO customer_info VALUES
 (1,&amp;#39;Joe&amp;#39;,&amp;#39;Smith&amp;#39;,&amp;#39;Denver&amp;#39;,2008),
 (2,&amp;#39;Bob&amp;#39;,&amp;#39;Jones&amp;#39;,&amp;#39;Boston&amp;#39;,2008),
 (3,&amp;#39;Silke&amp;#39;,&amp;#39;Muller&amp;#39;,&amp;#39;Frankfurt&amp;#39;,2007),
 (4,&amp;#39;Simone&amp;#39;,&amp;#39;Bernard&amp;#39;,&amp;#39;Paris&amp;#39;,2014),
 (5,&amp;#39;Vijay&amp;#39;,&amp;#39;Kumar&amp;#39;,&amp;#39;New Delhi&amp;#39;,2010);
 OUTPUT
--------
      5
(1 row)

=&amp;gt; COMMIT;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;View the table data:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM customer_info ORDER BY year DESC;
 customer_id | first_name | last_name |   city    | year
-------------+------------+-----------+-----------+------
           4 | Simone     | Bernard   | Paris     | 2014
           5 | Vijay      | Kumar     | New Delhi | 2010
           2 | Bob        | Jones     | Boston    | 2008
           1 | Joe        | Smith     | Denver    | 2008
           3 | Silke      | Muller    | Frankfurt | 2007
(5 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a second table, &lt;code&gt;member_info&lt;/code&gt;, that has the same definition as &lt;code&gt;customer_info&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE member_info LIKE customer_info INCLUDING PROJECTIONS;
CREATE TABLE
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Insert data into the &lt;code&gt;member_info&lt;/code&gt; table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; INSERT INTO member_info VALUES
(1,&amp;#39;Jane&amp;#39;,&amp;#39;Doe&amp;#39;,&amp;#39;Miami&amp;#39;,2001),
(2,&amp;#39;Mike&amp;#39;,&amp;#39;Brown&amp;#39;,&amp;#39;Chicago&amp;#39;,2014),
(3,&amp;#39;Patrick&amp;#39;,&amp;#39;OMalley&amp;#39;,&amp;#39;Dublin&amp;#39;,2008),
(4,&amp;#39;Ana&amp;#39;,&amp;#39;Lopez&amp;#39;,&amp;#39;Madrid&amp;#39;,2009),
(5,&amp;#39;Mike&amp;#39;,&amp;#39;Green&amp;#39;,&amp;#39;New York&amp;#39;,2008);
 OUTPUT
--------
      5
(1 row)
=&amp;gt; COMMIT;
COMMIT
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;View the data in the &lt;code&gt;member_info&lt;/code&gt; table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM member_info ORDER BY year DESC;
 customer_id | first_name | last_name |   city   | year
-------------+------------+-----------+----------+------
           2 | Mike       | Brown     | Chicago  | 2014
           4 | Ana        | Lopez     | Madrid   | 2009
           5 | Mike       | Green     | New York | 2008
           3 | Patrick    | OMalley   | Dublin   | 2008
           1 | Jane       | Doe       | Miami    | 2001
(5 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To swap the partitions, run the SWAP_PARTITIONS_BETWEEN_TABLES function:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SWAP_PARTITIONS_BETWEEN_TABLES(&amp;#39;customer_info&amp;#39;, 2008, 2009, &amp;#39;member_info&amp;#39;);
                                    SWAP_PARTITIONS_BETWEEN_TABLES
----------------------------------------------------------------------------------------------
 1 partition values from table customer_info and 2 partition values from table member_info are swapped at epoch 1045.

(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Query both tables to confirm that they swapped their respective 2008 and 2009 records:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM customer_info ORDER BY year DESC;
 customer_id | first_name | last_name |   city    | year
-------------+------------+-----------+-----------+------
           4 | Simone     | Bernard   | Paris     | 2014
           5 | Vijay      | Kumar     | New Delhi | 2010
           4 | Ana        | Lopez     | Madrid    | 2009
           3 | Patrick    | OMalley   | Dublin    | 2008
           5 | Mike       | Green     | New York  | 2008
           3 | Silke      | Muller    | Frankfurt | 2007
(6 rows)
=&amp;gt; SELECT * FROM member_info ORDER BY year DESC;
 customer_id | first_name | last_name |  city   | year
-------------+------------+-----------+---------+------
           2 | Mike       | Brown     | Chicago | 2014
           2 | Bob        | Jones     | Boston  | 2008
           1 | Joe        | Smith     | Denver  | 2008
           1 | Jane       | Doe       | Miami   | 2001
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Minimizing partitions</title>
      <link>/en/admin/partitioning-tables/managing-partitions/minimizing-partitions/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/partitioning-tables/managing-partitions/minimizing-partitions/</guid>
      <description>
        
        
        &lt;p&gt;By default, OpenText™ Analytics Database supports up to 1024 ROS containers to store partitions for a given projection (see &lt;a href=&#34;../../../../en/sql-reference/config-parameters/projection-parameters/#&#34;&gt;Projection parameters&lt;/a&gt;). A ROS container contains data that share the same partition key, or the same partition group key. Depending on the amount of data per partition, a partition or partition group can span multiple ROS containers.&lt;/p&gt;
&lt;p&gt;Given this limit, it is inadvisable to partition a table on highly granular data—for example, on a TIMESTAMP column. Doing so can generate a very high number of partitions. If the number of partitions requires more than 1024 ROS containers, the database issues a ROS pushback warning and refuses to load more table data. A large number of ROS containers also can adversely affect DML operations such as &lt;code&gt;DELETE&lt;/code&gt;, which requires the database to open all ROS containers.&lt;/p&gt;
&lt;p&gt;In practice, it is unlikely you will approach this maximum. For optimal performance, it is recommended that the number of ungrouped partitions range between 10 and 20, and not exceed 50. This range is typically compatible with most business requirements.&lt;/p&gt;
&lt;p&gt;You can also reduce the number of ROS containers by grouping partitions. For more information, see &lt;a href=&#34;../../../../en/admin/partitioning-tables/defining-partitions/partition-grouping/#&#34;&gt;Partition grouping&lt;/a&gt; and &lt;a href=&#34;../../../../en/admin/partitioning-tables/hierarchical-partitioning/#&#34;&gt;Hierarchical partitioning&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Viewing partition storage data</title>
      <link>/en/admin/partitioning-tables/managing-partitions/viewing-partition-storage-data/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/partitioning-tables/managing-partitions/viewing-partition-storage-data/</guid>
      <description>
        
        
        &lt;p&gt;OpenText™ Analytics Database provides various ways to view how your table partitions are organized and stored:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Query the 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/system-tables/v-monitor-schema/partitions/#&#34;&gt;PARTITIONS&lt;/a&gt;&lt;/code&gt; system table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Dump partition keys.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;querying-partitions-table&#34;&gt;Querying PARTITIONS table&lt;/h2&gt;
&lt;p&gt;The following table and projection definitions partition &lt;code&gt;store_order&lt;/code&gt; data on order dates, and groups together partitions of the same year:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE public.store_orders
  (order_no int, order_date timestamp NOT NULL, shipper varchar(20), ship_date date)
  PARTITION BY ((order_date)::date) GROUP BY (date_trunc(&amp;#39;year&amp;#39;, (order_date)::date));

=&amp;gt; CREATE PROJECTION public.store_orders_super
   AS SELECT order_no, order_date, shipper, ship_date FROM store_orders
   ORDER BY order_no, order_date, shipper, ship_date UNSEGMENTED ALL NODES;

=&amp;gt; COPY store_orders FROM &amp;#39;/home/dbadmin/export_store_orders_data.txt&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After loading data into this table, you can query the &lt;code&gt;PARTITIONS&lt;/code&gt; table to determine how many ROS containers store the grouped partitions for projection &lt;code&gt;store_orders_unseg&lt;/code&gt;, across all nodes. Each node has eight ROS containers, each container storing partitions of one partition group:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT COUNT (partition_key) NumPartitions, ros_id, node_name FROM PARTITIONS
       WHERE projection_name ilike &amp;#39;store_orders%&amp;#39; GROUP BY ros_id, node_name ORDER BY node_name, NumPartitions;
 NumPartitions |      ros_id       |    node_name
---------------+-------------------+------------------
           173 | 45035996274562779 | v_vmart_node0001
           211 | 45035996274562791 | v_vmart_node0001
           212 | 45035996274562783 | v_vmart_node0001
           213 | 45035996274562787 | v_vmart_node0001
           173 | 49539595901916471 | v_vmart_node0002
           211 | 49539595901916483 | v_vmart_node0002
           212 | 49539595901916475 | v_vmart_node0002
           213 | 49539595901916479 | v_vmart_node0002
           173 | 54043195529286985 | v_vmart_node0003
           211 | 54043195529286997 | v_vmart_node0003
           212 | 54043195529286989 | v_vmart_node0003
           213 | 54043195529286993 | v_vmart_node0003
(12 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;dumping-partition-keys&#34;&gt;Dumping partition keys&lt;/h2&gt;
&lt;p&gt;The database provides several functions that let you inspect how individual partitions are stored on the cluster, at several levels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/db-functions/dump-partition-keys/#&#34;&gt;DUMP_PARTITION_KEYS&lt;/a&gt;&lt;/code&gt; dumps partition keys of all projections in the system.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/partition-functions/dump-table-partition-keys/#&#34;&gt;DUMP_TABLE_PARTITION_KEYS&lt;/a&gt;&lt;/code&gt; dumps partition keys of all projections for the specified table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/management-functions/partition-functions/dump-projection-partition-keys/#&#34;&gt;DUMP_PROJECTION_PARTITION_KEYS&lt;/a&gt;&lt;/code&gt; dumps partition keys of the specified projection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Given the previous table and projection, &lt;code&gt;DUMP_PROJECTION_PARTITION_KEYS&lt;/code&gt; shows the contents of four ROS containers on each node:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT DUMP_PROJECTION_PARTITION_KEYS(&amp;#39;store_orders_super&amp;#39;);
 ...
 Partition keys on node v_vmart_node0001
  Projection &amp;#39;store_orders_super&amp;#39;
   Storage [ROS container]
     No of partition keys: 173
     Partition keys: 2017-01-02 2017-01-03 2017-01-04 2017-01-05 2017-01-06 2017-01-09 2017-01-10
2017-01-11 2017-01-12 2017-01-13 2017-01-16 2017-01-17 2017-01-18 2017-01-19 2017-01-20 2017-01-23
2017-01-24 2017-01-25 2017-01-26 2017-01-27 2017-02-01 2017-02-02 2017-02-03 2017-02-06 2017-02-07
2017-02-08 2017-02-09 2017-02-10 2017-02-13 2017-02-14 2017-02-15 2017-02-16 2017-02-17 2017-02-20
...
2017-09-01 2017-09-04 2017-09-05 2017-09-06 2017-09-07 2017-09-08 2017-09-11 2017-09-12 2017-09-13
2017-09-14 2017-09-15 2017-09-18 2017-09-19 2017-09-20 2017-09-21 2017-09-22 2017-09-25 2017-09-26 2017-09-27
   Storage [ROS container]
     No of partition keys: 212
     Partition keys: 2016-01-01 2016-01-04 2016-01-05 2016-01-06 2016-01-07 2016-01-08 2016-01-11
2016-01-12 2016-01-13 2016-01-14 2016-01-15 2016-01-18 2016-01-19 2016-01-20 2016-01-21 2016-01-22
2016-01-25 2016-01-26 2016-01-27 2016-02-01 2016-02-02 2016-02-03 2016-02-04 2016-02-05 2016-02-08
2016-02-09 2016-02-10 2016-02-11 2016-02-12 2016-02-15 2016-02-16 2016-02-17 2016-02-18 2016-02-19
...
2016-11-01 2016-11-02 2016-11-03 2016-11-04 2016-11-07 2016-11-08 2016-11-09 2016-11-10 2016-11-11
2016-11-14 2016-11-15 2016-11-16 2016-11-17 2016-11-18 2016-11-21 2016-11-22 2016-11-23 2016-11-24 2016-11-25
   Storage [ROS container]
     No of partition keys: 213
     Partition keys: 2015-01-01 2015-01-02 2015-01-05 2015-01-06 2015-01-07 2015-01-08 2015-01-09
2015-01-12 2015-01-13 2015-01-14 2015-01-15 2015-01-16 2015-01-19 2015-01-20 2015-01-21 2015-01-22
2015-01-23 2015-01-26 2015-01-27 2015-02-02 2015-02-03 2015-02-04 2015-02-05 2015-02-06 2015-02-09
2015-02-10 2015-02-11 2015-02-12 2015-02-13 2015-02-16 2015-02-17 2015-02-18 2015-02-19 2015-02-20
...
2015-11-02 2015-11-03 2015-11-04 2015-11-05 2015-11-06 2015-11-09 2015-11-10 2015-11-11 2015-11-12
2015-11-13 2015-11-16 2015-11-17 2015-11-18 2015-11-19 2015-11-20 2015-11-23 2015-11-24 2015-11-25
2015-11-26 2015-11-27
   Storage [ROS container]
     No of partition keys: 211
     Partition keys: 2014-01-01 2014-01-02 2014-01-03 2014-01-06 2014-01-07 2014-01-08 2014-01-09
2014-01-10 2014-01-13 2014-01-14 2014-01-15 2014-01-16 2014-01-17 2014-01-20 2014-01-21 2014-01-22
2014-01-23 2014-01-24 2014-01-27 2014-02-03 2014-02-04 2014-02-05 2014-02-06 2014-02-07 2014-02-10
2014-02-11 2014-02-12 2014-02-13 2014-02-14 2014-02-17 2014-02-18 2014-02-19 2014-02-20 2014-02-21
...
2014-11-04 2014-11-05 2014-11-06 2014-11-07 2014-11-10 2014-11-11 2014-11-12 2014-11-13 2014-11-14
2014-11-17 2014-11-18 2014-11-19 2014-11-20 2014-11-21 2014-11-24 2014-11-25 2014-11-26 2014-11-27
   Storage [ROS container]
     No of partition keys: 173
...
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
  </channel>
</rss>
