How can I find the column that a table is organized on in netezza?

I created a table in Netezza like this:

CREATE TABLE sample
( col1 int,
col2 int,
col3 int,
col4 int )
DISTRIBUTE ON HASH (col1,col2,col3)
ORGANIZE ON (col2);

      

After creating the table, I want to query the database to find in the column where the table is organized by . Since the above table is organized in "col2"

+3


source to share


1 answer


To find a column of a table organized on

, you can use one of the following system table

queries.

select *
from _v_odbc_columns1
where orgseqno is not null

      

or

select *
from _v_table_organize_column

      



To find the column (s), table distributed on

.

select tablename, owner, attname as distribution_column
from _v_table_dist_map

      

If the table is irrelevant, the table is distributed across random

;

+5


source







All Articles