The number of Heroku columns is incorrect

I used heroku for one of my applications, and today it disconnected because the number of lines exceeded 10,000 lines.

I do not understand how this number is obtained, although, as the rails say, I have only about 2,000 entries in db.

Running pg: info, I see the following:

Plan: Dev Status: available Connections: 1 PG Version: 9.1.5 Created: 2012-09-25 03:12 UTC Data Size: 11.0 MB Tables: 9 Rows: 15686/10000 (Write access revoked) Fork/Follow: Unavailable 

Can someone explain to me how I seem to be 15,000 rows, even though there are only 2,000 entries in the database?

Thank!

+21
heroku
Oct 03 '12 at 4:01
source share
3 answers

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

 heroku pg:psql YOUR_DB_URL 

then you can write this query to get the rank of the entries in the table:

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

If you only need an updated number. lines you can use

 SELECT sum(n_live_tup) FROM pg_stat_user_tables; 

Please note that you can have both the new db developer plan and the old SHARED one in your config (access to it via heroku pg:info ). You should insert the correct db url, possibly the one that has color.

Allow a 30 minute delay between any sql truncate and Rows to update.

By the way, the web console on http://heroku.com in my case has been updated with the correct number. during my sql queries. Maybe the toolkelt console updates for the hero will be slower.

+42
Oct 03
source share

I contacted Heroku support and they ran the following command to get my numbers ...

 $ heroku pg:info 
+1
Oct 07 '15 at 19:23
source share

30 minutes was not enough for me, so I made a backup and restored the database. Then my application reappeared on the net.

0
May 25 '16 at 8:44
source share



All Articles