Skip to content

Instantly share code, notes, and snippets.

View tiagomota's full-sized avatar

Tiago Mota tiagomota

  • Porto, Portugal
View GitHub Profile
@tiagomota
tiagomota / postgres_queries_and_commands.sql
Last active November 9, 2021 23:38 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- enter in postgres user
sudo su postgres
psql
-- clear machine/postgres cache to force fresh disk reads on queries
1. Shutdown the database server --(pg_ctl, sudo service postgresql stop, etc.)
2. echo 3 > /proc/sys/vm/drop_caches --This will clear out the OS file/block caches - very important though I don't know how to do that on other OSs.
3. Start the database server
-- *****************************