You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@trafodion.apache.org by Dido_vansa <52...@qq.com> on 2016/09/12 06:52:15 UTC

command

Hi!

I have a problem about sql command in trafodion .
I want to obtain row length in a table , but I do not understand which command I can use in this case.
I'm looking forward to your reply


Best regards,
Forling

RE: command

Posted by Anoop Sharma <an...@esgyn.com>.
one can also use traf metadata tables view to get this info.

  select row_data_length, row_total_length from "_MD_".tables_view where
schema_name = 'your-sch' and table_name = 'your-tab';

row_data_length: length of row for the data part of table. This is the sum
of lengths of all columns in the table plus 1 byte per nullable col.
row_total_length: in addition to row_data_length, this includes hbase
overhead for each stored hbase cell/column and
                    includes key length, timestamp and column family length.
                    If table is created as an aligned format table, this
hbase overhead is minimal as all columns are packed and stored as one cell.

anoop
-----Original Message-----
From: Liu, Ming (Ming) [mailto:ming.liu@esgyn.cn]
Sent: Monday, September 12, 2016 2:49 AM
To: user@trafodion.incubator.apache.org; dev
<de...@trafodion.incubator.apache.org>
Subject: RE: command

Hi, Forling,

You can try to search in the system metadata, here is an example

select ROW_TOTAL_LENGTH , ROW_DATA_LENGTH from "_MD_".tables ,
"_MD_".objects where “_MD_”.objects.OBJECT_UID = “_MD_”.tables.table_uid
and objects.OBJECT_NAME='your_table_name’;

and you can check other columns in the “_MD_”.tables to see if there are
other info you need.

Others may have better approach, since I heard there are some new defined
system dictionary and views. Or maybe some new utility to grab these
information. But above query is one method.

Thanks,
Ming

From: Dido_vansa [mailto:523766410@qq.com]
Sent: Monday, September 12, 2016 2:52 PM
To: user <user@trafodion.incubator.apache.org
<ma...@trafodion.incubator.apache.org> >; dev
<dev@trafodion.incubator.apache.org
<ma...@trafodion.incubator.apache.org> >
Subject: command

Hi!

I have a problem about sql command in trafodion .
I want to obtain row length in a table , but I do not understand which
command I can use in this case.
I'm looking forward to your reply


Best regards,
Forling

RE: command

Posted by Anoop Sharma <an...@esgyn.com>.
one can also use traf metadata tables view to get this info.

  select row_data_length, row_total_length from "_MD_".tables_view where
schema_name = 'your-sch' and table_name = 'your-tab';

row_data_length: length of row for the data part of table. This is the sum
of lengths of all columns in the table plus 1 byte per nullable col.
row_total_length: in addition to row_data_length, this includes hbase
overhead for each stored hbase cell/column and
                    includes key length, timestamp and column family length.
                    If table is created as an aligned format table, this
hbase overhead is minimal as all columns are packed and stored as one cell.

anoop
-----Original Message-----
From: Liu, Ming (Ming) [mailto:ming.liu@esgyn.cn]
Sent: Monday, September 12, 2016 2:49 AM
To: user@trafodion.incubator.apache.org; dev
<de...@trafodion.incubator.apache.org>
Subject: RE: command

Hi, Forling,

You can try to search in the system metadata, here is an example

select ROW_TOTAL_LENGTH , ROW_DATA_LENGTH from "_MD_".tables ,
"_MD_".objects where “_MD_”.objects.OBJECT_UID = “_MD_”.tables.table_uid
and objects.OBJECT_NAME='your_table_name’;

and you can check other columns in the “_MD_”.tables to see if there are
other info you need.

Others may have better approach, since I heard there are some new defined
system dictionary and views. Or maybe some new utility to grab these
information. But above query is one method.

Thanks,
Ming

From: Dido_vansa [mailto:523766410@qq.com]
Sent: Monday, September 12, 2016 2:52 PM
To: user <user@trafodion.incubator.apache.org
<ma...@trafodion.incubator.apache.org> >; dev
<dev@trafodion.incubator.apache.org
<ma...@trafodion.incubator.apache.org> >
Subject: command

Hi!

I have a problem about sql command in trafodion .
I want to obtain row length in a table , but I do not understand which
command I can use in this case.
I'm looking forward to your reply


Best regards,
Forling

RE: command

Posted by "Liu, Ming (Ming)" <mi...@esgyn.cn>.
Hi, Forling,

You can try to search in the system metadata, here is an example

select ROW_TOTAL_LENGTH , ROW_DATA_LENGTH from "_MD_".tables , "_MD_".objects where “_MD_”.objects.OBJECT_UID = “_MD_”.tables.table_uid and objects.OBJECT_NAME='your_table_name’;

and you can check other columns in the “_MD_”.tables to see if there are other info you need.

Others may have better approach, since I heard there are some new defined system dictionary and views. Or maybe some new utility to grab these information. But above query is one method.

Thanks,
Ming

From: Dido_vansa [mailto:523766410@qq.com]
Sent: Monday, September 12, 2016 2:52 PM
To: user <us...@trafodion.incubator.apache.org>; dev <de...@trafodion.incubator.apache.org>
Subject: command

Hi!

I have a problem about sql command in trafodion .
I want to obtain row length in a table , but I do not understand which command I can use in this case.
I'm looking forward to your reply


Best regards,
Forling

RE: command

Posted by "Liu, Ming (Ming)" <mi...@esgyn.cn>.
Hi, Forling,

You can try to search in the system metadata, here is an example

select ROW_TOTAL_LENGTH , ROW_DATA_LENGTH from "_MD_".tables , "_MD_".objects where “_MD_”.objects.OBJECT_UID = “_MD_”.tables.table_uid and objects.OBJECT_NAME='your_table_name’;

and you can check other columns in the “_MD_”.tables to see if there are other info you need.

Others may have better approach, since I heard there are some new defined system dictionary and views. Or maybe some new utility to grab these information. But above query is one method.

Thanks,
Ming

From: Dido_vansa [mailto:523766410@qq.com]
Sent: Monday, September 12, 2016 2:52 PM
To: user <us...@trafodion.incubator.apache.org>; dev <de...@trafodion.incubator.apache.org>
Subject: command

Hi!

I have a problem about sql command in trafodion .
I want to obtain row length in a table , but I do not understand which command I can use in this case.
I'm looking forward to your reply


Best regards,
Forling