Skip to main content

Loading into cache from said PostgreSQL database the tables, which are most frequently scanned.

Project description

Limiter for loading into cache is the value of “effective_cache_size”.

It makes sense to use after restarting the server!

Before using, you need to connect to the database as superuser and add the extension ‘pg_prewarm’ (added to PostgreSQL since version 9.4):

create extension pg_prewarm;


pg_hotcache [-?] [-h HOST] [-p PORT] [-U USERNAME] [-W PASSWORD] -d DBNAME

Optional arguments:

-?, --help            show this help message and exit
-h HOST, --host HOST  database server host or socket directory (default:
                      "local socket")
-p PORT, --port PORT  database server port (default: "5432")
                      database user name (default: "unix user")
                      force password prompt (should happen automatically)
-d DBNAME, --dbname DBNAME
                      database name for caching


sudo -u postgres pg_hotcache -d dbname
pg_hotcache -h -p 5432 -U username -d dbname

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pg_hotcache, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size pg_hotcache-0.2.1.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page