All Products
Search
Document Center

Hologres:Upgrade storage format of column-oriented table

Last Updated:Mar 26, 2026

Before Hologres V0.10, column-oriented tables used the legacy Segment format. Starting from V0.10, new column-oriented tables default to the AliORC format (orc), which provides better data compression and lower storage costs. Hologres V1.3 and later no longer support creating Segment-format tables. This topic describes how to check the current storage format of your tables and migrate existing tables to ORC format.

Storage formats

Hologres stores data in three formats:

FormatTable typeDescription
segmentColumn-orientedLegacy per-column file format. Default for column-oriented tables in versions earlier than V0.10. No longer supported for new tables in V1.3 and later.
orcColumn-orientedAliORC columnar format. Default for column-oriented tables since V0.10. Provides better data compression and lower storage costs than segment.
sstRow-orientedDefault format for row-oriented tables.
Note

You cannot convert a column-oriented table to a row-oriented table by changing the storage format. To change the table type, create a new table with the required schema.

Prerequisites

Before you begin, make sure that you have:

  • A Hologres instance running V0.10 or later. Check your instance version on the instance details page in the Hologres console. If your instance version is earlier than V0.10, upgrade it first. If you encounter errors during the upgrade, see Common errors during upgrade preparation or get online support

Check the storage format

Run the following SQL statement to see the storage format of each table in the current database:

SELECT *
FROM hologres.hg_table_properties
WHERE property_key = 'storage_format';

Example output:

 table_namespace |     table_name     |  property_key  | property_value
-----------------+--------------------+----------------+----------------
 public          | part               | storage_format | segment
 public          | partsupp           | storage_format | segment
 public          | customer           | storage_format | segment
 public          | orders_row         | storage_format | sst
 public          | sp_orders          | storage_format | segment
 public          | sp_orders_20161231 | storage_format | segment
 public          | sp_orders_20171231 | storage_format | segment
 public          | sp_orders_20181231 | storage_format | segment
 public          | lineitem           | storage_format | segment
 public          | nation             | storage_format | orc
 public          | region             | storage_format | orc
 public          | supplier           | storage_format | orc
 public          | orders             | storage_format | orc
(13 rows)

Tables with property_value of segment need to be migrated to ORC format.

Convert a single table to ORC format

Important

After the command runs, a background process asynchronously converts the data to ORC. This process consumes CPU, I/O, and network bandwidth resources and may affect the performance of online services. Run this command during off-peak hours.

Run the following command to change the storage format of one table:

call set_table_property ('table_name', 'storage_format', 'orc');

Replace table_name with the name of your table. The following example converts the part table:

call set_table_property ('public.part', 'storage_format', 'orc');

Limits

  • Convert one table at a time. This command does not support batch conversion.

  • For a partitioned table, run the command on the parent table only.

Batch convert tables from Segment to ORC format

Hologres V1.3.35 and later support batch conversion from Segment to ORC format. Use this approach when you have many existing Segment tables to migrate.

Important

The batch conversion command runs asynchronously and consumes CPU and memory resources, which can affect online services. Run it during off-peak hours.

Step 1: Identify Segment tables in the current database.

select * from hologres.hg_table_properties
where property_key = 'storage_format' and property_value like '%segment%';

If the query returns an empty result, no tables in the current database need conversion.

Step 2: Start the batch conversion.

call hg_convert_segment_orc([<BATCH_SIZE>]);

BATCH_SIZE is optional. It specifies the number of tables to convert concurrently. The default is 100.

The command works as follows:

  1. Returns a success message immediately and starts the conversion in the background.

  2. Converts up to BATCH_SIZE tables concurrently per run.

  3. Consumes CPU and memory resources during the conversion. Monitor these metrics — a drop in CPU and memory usage indicates that the conversion is complete. The conversion typically takes several minutes to several hours depending on data volume.

  4. If the command returns an empty result, all tables in the current database have been converted or are already being converted.

  5. If the command returns continue to call hg_convert_segment_orc() if you want to convert all tables in current database., more tables remain. Continue running the command until it returns an empty result.

Repeat Steps 1 and 2 for each database in your instance.

Automatic conversion when creating a Segment table (V1.3.29 and later)

Starting from Hologres V1.3.29, if you run a CREATE TABLE statement with the Segment format, the system automatically converts the format to ORC and returns the following notice:

NOTICE:storage format 'segment' is no longer supported,converted to 'orc'