【问题标题】:Phantom rows in table表格中的虚拟行
【发布时间】:2019-03-21 17:00:38
【问题描述】:

我的爱好计划数据库目前超过了 10,000 行的限制,这让我感到困惑,因为我有一个每小时计划的工作,可以提前清除旧行。

psql-extras 工具带报告了这一点:

heroku pg:index_usage -a my-app
    relname     | percent_of_times_index_used | rows_in_table 
----------------+-----------------------------+---------------
 table_one      | 26                          |          8710
 table_two      | Insufficient data           |          1235
 table_three    | 73                          |           637
 table_four     | 0                           |           429
 table_five     |                             |             1
(5 rows)

所以这超出了限制......但是,当我 SELECT COUNT(*) 每个表中的行(这是我计划的工作所做的)时,我只能找到大约 8,000 行。

table_one为例:

$ heroku psql -a my-app
--> Connecting to postgresql-my-db
psql (11.1, server 9.6.11)
SSL connection (protocol: TLSv1.2, ...)
Type "help" for help.

my-app::DATABASE=> SELECT COUNT(*) FROM table_one;
 count 
-------
  5708
(1 row)

有谁知道这 3,000 多行是从哪里来的?

非常感谢。

【问题讨论】:

    标签: heroku heroku-postgres


    【解决方案1】:

    AUTOVACUUM 似乎已经解决了。不知道为什么在事情运行良好一年多之后会发生这种情况,但没关系。

    【讨论】:

      猜你喜欢
      • 2023-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-03
      • 2011-01-11
      • 1970-01-01
      • 2012-02-14
      相关资源
      最近更新 更多