suggestion: log_statement = sample - Mailing list pgsql-general

From Janning Vygen
Subject suggestion: log_statement = sample
Date
Msg-id 200903161426.56662.vygen@kicktipp.de
Whole thread Raw
List pgsql-general
Hi,

we ran a large database on moderate hardware. Disks are usually the slowest
part so we do not log every statement. Sometimes we do and our IOwait and CPU
increases by 10%. too much for peak times!

it would be nice if you could say:

  log_statement = sample
  sample_rate = 100

you would get a good sample to analyze your database usage. Of course
log_min_duration helps a lot as you see your slowest queries. But with a tool
like hibernate, you have often have the problem issuing many many small
statements like "SELECT * from table where id = ?".

They don't show up in the log with a reasonable log_min_duration setting.

With my proposal every 100th query is logged and you get a detailed view of
your database usage without excessive disk IO. Of course it should be
combinable with log_min_duration.

What do you think about it?

kind regards
Janning



pgsql-general by date:

Previous
From: "Nagalingam, Karthikeyan"
Date:
Subject: deployment query
Next
From: Janning Vygen
Date:
Subject: large table starting sequence scan because of default_statistic_target