Heroku Row Count Incorrect

后端 未结 3 1426
[愿得一人]
[愿得一人] 2020-12-13 07:08

I\'ve been using heroku for one of my applications and it got shutdown today because the row count has exceeded 10,000 rows.

I don\'t understanding how this figure i

相关标签:
3条回答
  • 2020-12-13 07:35

    30 mins weren't enough for me, so I took a backup and restored the database. Then my app came back online.

    0 讨论(0)
  • 2020-12-13 07:51

    I contacted Heroku Support on this and they ran the following command to get my numbers...

    $ heroku pg:info
    
    0 讨论(0)
  • 2020-12-13 07:53

    Rails alone is not enough. Heroku has a nice SQL console that you can access with:

    heroku pg:psql YOUR_DB_URL
    

    then you can write this query to obtain a rank of records per table:

    SELECT schemaname,relname,n_live_tup 
      FROM pg_stat_user_tables 
      ORDER BY n_live_tup DESC;
    

    If you need only the updated num. of rows, you can use

    SELECT sum(n_live_tup) FROM pg_stat_user_tables;
    

    Please note that you can have both the new dev plan db and the old SHARED one in your config (access it by heroku pg:info). You have to insert the correct db url, probably the one with a color.

    Allow a 30 mins delay between any sql truncate and the Rows count to update.

    BTW the web console on http://heroku.com in my case was updated with the correct num. during my sql queries. May be heroku toolbelt console updates, are slower.

    0 讨论(0)
提交回复
热议问题