Log Every Query in Local Development
How to log every SQL statement in local PostgreSQL and MySQL, which settings to use, what it costs, and how to switch it off again safely.
Blog / Tag
How to log every SQL statement in local PostgreSQL and MySQL, which settings to use, what it costs, and how to switch it off again safely.
Read a PostgreSQL EXPLAIN plan node by node, from costs and row estimates to scan and join types, EXPLAIN ANALYZE and BUFFERS, plus MySQL basics.
Run PostgreSQL 15, 16 and 17 on one machine using separate data directories and ports, with exact initdb and pg_ctl commands and common pitfalls.
Use log_min_duration_statement and pg_stat_statements to find slow PostgreSQL queries, with exact settings, units and what needs a restart.