Statistical object size function Performance comparison

Source: Internet
Author: User
Tags comparison
gtgpdb=# SELECT * from Gp_toolkit.gp_size_of_table_disk t where sotdtablename like ' rt_ok% ';  sotdoid | Sotdsize | Sotdtoastsize | Sotdadditionalsize |             Sotdschemaname | Sotdtablename---------+-------------+---------------+--------------------+----------------+-----------------           ----------------------1503170 |       0 |            1081344 | 1441792 | GT | RT_OK 1503197 |       32879790712 |            1081344 | 7634944 | GT |           rt_ok_1_prt_event_time20150105 1503225 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20150106 1503300 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20150107 1503351 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20150108 1503402 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20150109 1503453 |       0 |  1081344 |          1081344 | GT |           rt_ok_1_prt_event_time20141220 1503504 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141221 1503555 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141222 1503606 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141223 1503657 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141224 1503708 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141225 1503759 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141226 1503810 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141227 1503861 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141228 1503912 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141229 1503963 |       0 |            1081344 | 1081344 | GT |           rt_ok_1_prt_event_time20141230 1504014 |       0 |            1081344 | 1081344 | GT | rt_ok_1_prt_event_time20141231 (rows) time:103713.791 ms gtgpdb=# SELECT * FROM Gp_toolkit.gp_size_of_table_disk t W
 Here sotdtablename like ' manager_table '; sotdoid | Sotdsize | Sotdtoastsize | Sotdadditionalsize | Sotdschemaname | Sotdtablename---------+----------+---------------+--------------------+----------------+---------------1441033   |             327680 |                  0 | 0 | GPMG | Manager_table (1 row) time:35004.159 Ms gtgpdb=# Select Select A.schemaname, A.tablename, A.tableowner,pg_total_relatio N_size (a.schemaname| |
a.tablename) size from Pg_tables a where a.tablename like ' manager_table ';
        Error:syntax error at or near ' select ' line 1:select select A.schemaname, A.tablename, A.tableowner,pg_tot ...       ^ gtgpdb=# Select A.schemaname, A.tablename, a.tableowner,pg_total_relation_size (a.schemaname| | '. ' | |       
 a.tablename) size from Pg_tables a where a.tablename like ' manager_table ';   SchemaName | TableName |  Tableowner | Size------------+---------------+------------+---------GPMG | manager_table | Gpadmin | 1736704 (1 row) time:341.430 Ms gtgpdb=# Select A.schemaname, A.tablename, A.tableowner,pg_total_relation_size (A.schema name| | '. ' | |
 a.tablename) size from Pg_tables a where a.tablename like ' rt_ok% ';               SchemaName | TableName |    Tableowner | Size------------+---------------------------------------+------------+-------------GT | RT_OK |     GT | 2523136 GT | rt_ok_1_prt_event_time20150105 | GT | 33318650192 GT | rt_ok_1_prt_event_time20150106 |     GT | 2162688 GT | rt_ok_1_prt_event_time20150107 |     GT | 2162688 GT | Rt_ok_1_prt_event_time20150108 |     GT | 2162688 GT | rt_ok_1_prt_event_time20150109 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141220 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141221 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141222 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141223 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141224 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141225 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141226 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141227 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141228 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141229 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141230 |     GT | 2162688 GT | rt_ok_1_prt_event_time20141231 |     GT | 2162688 (rows) time:414.039 ms gtgpdb=# SelecT a.schemaname, A.tablename, a.tableowner,pg_total_relation_size (a.schemaname| | '. ' | |
 a.tablename) size from Pg_tables a where a.tablename like ' manager_table ';   SchemaName | TableName |  Tableowner | Size------------+---------------+------------+---------GPMG | manager_table | Gpadmin | 1736704 (1 row) time:330.197 ms gtgpdb=# SELECT * from Gp_toolkit.gp_size_of_table_disk t where sotdtablename like ' Man                                                                  Ager_table '; sotdoid | Sotdsize | Sotdtoastsize | Sotdadditionalsize | Sotdschemaname | Sotdtablename---------+----------+---------------+--------------------+----------------+---------------1441033   |             327680 |                  0 | 0 | GPMG | Manager_table (1 row) time:26882.409 ms gtgpdb=# SELECT * from Gp_toolkit.gp_size_of_table_disk t where Sotdtablename l
 Ike ' manager_table '; sotdoid | Sotdsize | Sotdtoastsize | Sotdadditionalsize | Sotdschemaname | Sotdtablename---------+----------+---------------+--------------------+----------------+---------------1441033 |             327680 |                  0 | 0 | GPMG |
Manager_table (1 row) time:25308.524 ms gtgpdb=# vacuum analyze gpmg.manager_table; VACUUM time:2734.580 ms gtgpdb=# SELECT * from Gp_toolkit.gp_size_of_table_disk t where sotdtablename like ' manager_table
 '; sotdoid | Sotdsize | Sotdtoastsize | Sotdadditionalsize | Sotdschemaname | Sotdtablename---------+----------+---------------+--------------------+----------------+---------------1441033   |             327680 |                  0 | 0 | GPMG | Manager_table (1 row) time:25073.932 ms gtgpdb=# SELECT * from Gp_toolkit.gp_size_of_table_disk t where Sotdtablename l
 Ike ' manager_table '; sotdoid | Sotdsize | Sotdtoastsize | Sotdadditionalsize | Sotdschemaname | Sotdtablename---------+----------+---------------+--------------------+----------------+---------------1441033   |             327680 |    0 |              0 | GPMG | Manager_table (1 row) time:25596.315 Ms gtgpdb=# Select A.schemaname, A.tablename, A.tableowner,pg_total_relation_size ( a.schemaname| | '. ' | |
 a.tablename) size from Pg_tables a where a.tablename like ' manager_table ';   SchemaName | TableName |  Tableowner | Size------------+---------------+------------+---------GPMG | manager_table | Gpadmin | 1736704 (1 row) time:28.949 Ms gtgpdb=# Select A.schemaname, A.tablename, A.tableowner,pg_total_relation_size (A.scheman ame| | '. ' | |
 a.tablename) size from Pg_tables a where a.tablename like ' manager_table ';   SchemaName | TableName |  Tableowner | Size------------+---------------+------------+---------GPMG | manager_table | Gpadmin | 1736704 (1 row) time:21.122 Ms gtgpdb=# Select A.schemaname, A.tablename, a.tableowner,pg_relation_size (a.schemaname| | '.'||
 a.tablename) size from Pg_tables a where a.tablename like ' manager_table ';   SchemaName | TableName |  Tableowner | SizE------------+---------------+------------+--------GPMG | manager_table | Gpadmin | 327680 (1 row) time:313.303 Ms gtgpdb=# Select A.schemaname, A.tablename, a.tableowner,pg_relation_size (a.schemaname| | '.'||
 a.tablename) size from Pg_tables a where a.tablename like ' manager_table ';   SchemaName | TableName |  Tableowner | Size------------+---------------+------------+--------GPMG | manager_table | Gpadmin | 327680 (1 row)

The result is obvious whether the function can be used directly or directly, avoiding the use of the encapsulated view, even the system view.

-eof-

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.