Re: [HACKERS] pg_stat_statements and planning time

2012-03-08 Thread Robert Haas
On Wed, Mar 7, 2012 at 9:59 PM, Fujii Masao masao.fu...@gmail.com wrote: I'd like to have the planning time in a number of other places as well, such as EXPLAIN, and maybe statistics views. +1 for EXPLAIN. But which statistics views are in your mind? I don't know. I'm not sure if it's

Re: [HACKERS] pg_stat_statements and planning time

2012-03-08 Thread Peter Geoghegan
On 8 March 2012 13:09, Robert Haas robertmh...@gmail.com wrote:  Then again, considering that gettimeofday is kinda expensive, I suppose that would have to be optional if we were to have it at all. +1. I'm not opposed to having such a mechanism, but it really ought to impose exactly no overhead

Re: [HACKERS] pg_stat_statements and planning time

2012-03-08 Thread Tom Lane
Peter Geoghegan pe...@2ndquadrant.com writes: On 8 March 2012 13:09, Robert Haas robertmh...@gmail.com wrote:  Then again, considering that gettimeofday is kinda expensive, I suppose that would have to be optional if we were to have it at all. +1. I'm not opposed to having such a mechanism,

Re: [HACKERS] pg_stat_statements and planning time

2012-03-08 Thread Peter Geoghegan
On 8 March 2012 14:44, Tom Lane t...@sss.pgh.pa.us wrote: I thought the proposal was to add it to (1) pg_stat_statement and (2) EXPLAIN, both of which are not in the normal code execution path. pg_stat_statement is already a drag on a machine with slow gettimeofday, but it's not clear why

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Simon Riggs
On Wed, Mar 7, 2012 at 11:45 AM, Fujii Masao masao.fu...@gmail.com wrote: Attached patch extends pg_stat_statements so that it reports the planning time. Thought? If we successfully aggregate SQL in the current patch then this might be useful as well. Until we do that it's not much use. --  

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Fujii Masao
On Wed, Mar 7, 2012 at 9:00 PM, Simon Riggs si...@2ndquadrant.com wrote: On Wed, Mar 7, 2012 at 11:45 AM, Fujii Masao masao.fu...@gmail.com wrote: Attached patch extends pg_stat_statements so that it reports the planning time. Thought? If we successfully aggregate SQL in the current patch

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Robert Haas
On Wed, Mar 7, 2012 at 6:45 AM, Fujii Masao masao.fu...@gmail.com wrote: pg_stat_statements is basically very helpful to find out slow queries. But since it doesn't report the time spent in the planner, we cannot find out slow queries which take most time to do query planning, from

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Tom Lane
Fujii Masao masao.fu...@gmail.com writes: In the patch, I didn't change the column name total_time meaning the time spent in the executor because of the backward compatibility. But once new column plan_time is added, total_time is confusing and ISTM it should be renamed... Well, if we were

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Daniel Farina
On Wed, Mar 7, 2012 at 8:07 AM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com writes: In the patch, I didn't change the column name total_time meaning the time spent in the executor because of the backward compatibility. But once new column plan_time is added, total_time

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Fujii Masao
On Thu, Mar 8, 2012 at 12:39 AM, Robert Haas robertmh...@gmail.com wrote: On Wed, Mar 7, 2012 at 6:45 AM, Fujii Masao masao.fu...@gmail.com wrote: pg_stat_statements is basically very helpful to find out slow queries. But since it doesn't report the time spent in the planner, we cannot find

Re: [HACKERS] pg_stat_statements and planning time

2012-03-07 Thread Fujii Masao
On Thu, Mar 8, 2012 at 1:07 AM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com writes: In the patch, I didn't change the column name total_time meaning the time spent in the executor because of the backward compatibility. But once new column plan_time is added, total_time