java - How to get an explain analyze on a jdbc commit? -


this question has answer here:

i using postgres database, , want optimize program's speed. have auto commit set false. how can explain analyze on foo.commit()?

you cannot, because there no query plan commit, , explain analyze applies planned queries.

if want execution duration commit, can time client-side, or can set log_min_duration_statement 0 , client_min_messages log capture logs server sends you.

if you're attempting find out why commit slow, you're better off looking into:

  • checkpoint durations; see log_checkpoints
  • pg_test_fsync results storage subsystem
  • whether there deferrable constraints , constraint triggers in use;
  • overall system write load

Comments