How Do I Check Whether a DWS Table Is Row-Stored or Column-Stored?
The storage mode of a table is controlled by the ORIENTATION parameter in the CREATE TABLE statement. row indicates row storage, and column indicates column storage. If ORIENTATION is not specified, row storage is used by default.
You can use the table definition function pg_get_tabledef() to check whether a created table is row-stored or column-stored.
Example: Query the definition of the customer_t1 table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | SELECT * FROM PG_GET_TABLEDEF('customer_t1'); pg_get_tabledef ------------------------------------------------------------------------------------------------------------ SET search_path = public; + 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_hstore_opt=false, enable_delta=false)+ DISTRIBUTE BY HASH(c_last_name) + TO GROUP group_version1; (1 row) |
In the returned result, orientation=column indicates that customer_t1 is a column-store table.
DWS does not allow you to modify the ORIENTATION parameter using the ALTER TABLE statement. That is, row-store tables and column-store tables cannot be directly converted.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot