How Do I Check Whether a Table Is Row-Stored or Column-Stored?
The storage mode of a table is controlled by the ORIENTATION parameter in the table creation statement. row indicates row storage, and column indicates column storage.
In 8.1.2 and earlier versions, if ORIENTATION is not specified, row storage is used by default.
In versions later than 8.1.3, the default_orientation parameter can be used to control the storage mode. If the parameter ORIENTATION is not specified during table creation, the table storage mode is based on the value of default_orientation. row indicates a row-store table, column indicates a column-store table, and column enabledelta indicates that a column-store table with delta enabled is created. The GUC parameter can be configured on the GaussDB(DWS) console, as shown in the following figure.
You can use the table definition function PG_GET_TABLEDEF to check whether the created table is row-store or column-store.
For example, orientation=column indicates a column-store table.
Currently, you cannot run the ALTER TABLE statement to modify the parameter ORIENTATION.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
SELECT * FROM PG_GET_TABLEDEF('customer_t1');
pg_get_tabledef
-----------------------------------------------------------------------------------
SET search_path = tpchobs; +
CREATE TABLE customer_t1 ( +
c_customer_sk integer, +
c_customer_id character(5), +
c_first_name character(6), +
c_last_name character(8) +
) +
WITH (orientation=column, compression=middle, colversion=2.0, enable_delta=false)+
DISTRIBUTE BY HASH(c_last_name) +
TO GROUP group_version1;
(1 row)
|
Database Usage FAQs
- How Do I Change Distribution Columns?
- How Do I View and Set the Database Character Encoding?
- What Do I Do If Date Type Is Automatically Converted to the Timestamp Type During Table Creation?
- Do I Need to Run VACUUM FULL and ANALYZE on Common Tables Periodically?
- Do I Need to Set a Distribution Key After Setting a Primary Key?
- Is GaussDB(DWS) Compatible with PostgreSQL Stored Procedures?
- What Are Partitioned Tables, Partitions, and Partition Keys?
- How Can I Export the Table Structure?
- How Can I Delete Table Data Efficiently?
- How Do I View Foreign Table Information?
- If No Distribution Column Is Specified, How Will Data Be Stored?
- How Do I Replace the Null Result with 0?
- How Do I Check Whether a Table Is Row-Stored or Column-Stored?
- How Do I Query the Information About GaussDB(DWS) Column-Store Tables?
- Why Sometimes the GaussDB(DWS) Query Indexes Become Invalid?
- How Do I Use a User-Defined Function to Rewrite the CRC32() Function?
- What Are the Schemas Starting with pg_toast_temp* or pg_temp*?
- Solutions to Inconsistent GaussDB(DWS) Query Results
- Which System Catalogs That the VACUUM FULL Operation Cannot Be Performed on?
- In Which Scenarios Would a Statement Be "idle in transaction"?
- How Does GaussDB(DWS) Implement Row-to-Column and Column-to-Row Conversion?
- What Are the Differences Between Unique Constraints and Unique Indexes?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
more