【问题标题】:How to find the number of rows in a table in greenplum without using count(*)如何在不使用count(*)的情况下在greenplum中查找表中的行数
【发布时间】:2018-11-14 05:35:15
【问题描述】:
Select count(*) from table;

执行需要花费太多时间我想要任何系统表中的表中的行数。

【问题讨论】:

    标签: database greenplum


    【解决方案1】:

    您可以尝试以下查询以获取大致的行数。

    select reltuples from pg_class WHERE relname = 'table1';
    

    【讨论】:

    • 谢谢,但我需要准确的行数。
    • 除了 pg_class,count(*) 是获取表中行数的唯一选项。如果需要更多时间,请对表执行真空和分析操作。还要检查表数据是否分布正确
    猜你喜欢
    • 2018-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-26
    • 1970-01-01
    • 2015-01-21
    • 2018-07-08
    相关资源
    最近更新 更多