The fastest way to find out the size of the base of the hero

What is the fastest way to find out the current size of my shared database in Heroku?

+52
ruby-on-rails postgresql heroku
Nov 18 '10 at 22:23
source share
6 answers

running heroku info shows:

 Data size: 480k Addons: Basic Logging, Shared Database 5MB 

Data size is the size of a shared database, here with a limit of 5 MB.

+57
Nov 18 '10 at 22:48
source share

On the same page of the document as nate c:

 heroku pg:info 

This only works if you are not using a shared database, but are using PG as an add-on.

Also, make sure your hero hero is updated:

 sudo gem update heroku 

Any ideas on how to see the size of a shared database? I just did heroku db: pull and then mysqldump and looked at the file size, thought it was a good rough estimate.

+41
Dec 03 '10 at 23:07
source share

The new way is as follows:

 heroku pg:info -a myapp 

You will see something like:

 === HEROKU_POSTGRESQL_PURPLE_URL (DATABASE_URL) Plan: Dev Status: available Connections: 1 PG Version: 9.1.5 Created: 2012-10-19 01:27 UTC Data Size: 12.1 MB Tables: 31 Rows: 36068/10000 (Above limits, access disruption imminent) Fork/Follow: Unavailable 
+10
Oct 23 '12 at 16:29
source share

Based on Nate's answer:

For a shared database without installing Postgres on your local computer

 heroku console ActiveRecord::Base.connection.execute("SELECT pg_size_pretty(pg_database_size('postgres'))").first 

'postgres' is the name of my shared database, when I put in pattern0 or pattern1, I get the same number back.

+7
Jan 12 2018-11-11T00:
source share

You can directly enter Posgtgresql.

type heroku pg:psql .

But you should also have postgres on your local system, so you can use pgsql (which is the command line interface for pg.)

If you do not know what the db name is, enter \l in pgsql to display the databases. (postgres, template0, and template1 are system databases for each installation.)

Then SELECT pg_size_pretty(pg_database_size('dbname'));

+6
Nov 18 '10 at 23:30
source share

In the herogu postgres panel you can see everything https://postgres.heroku.com/

+1
Jan 09 '13 at
source share



All Articles