Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to log any one execution of sql transaction script as desired? I don't want to have logging turned on all the time as I only need information from the transaction to generate a profiler report via ?!

share|improve this question

Sure. before this transaction do:

set log_min_duration_statement=0;

do your things, and then reset it back to original value.

But. There is no point in profiling single transaction, unless it's several thousand commands long. Otherwise - you can just read the logs. But remember - timing based on single executed transactions are practically worthless.

share|improve this answer
I am profiling a sql script to find out how much time is taken for each statement :) – Jeffrey04 Oct 2 '09 at 6:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.