Use
EXPLAIN(ANALYZE, VERBOSE, BUFFERS, SETTINGS)
for your statements and the documentation : postgresql.org/docs/current/using-explain.html