Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Overhead for stats_command_string et al, take

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Overhead for stats_command_string et al, take
Date: 2006-06-26 21:49:31
Message-ID: 200606262149.k5QLnWr22989@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Tom Lane wrote:
> >> This is an ugly patch.  Why not *one* test of the GUC variable, inside
> >> set_ps_display(), and no side-effects on callers?  You would need to
> >> force an initial update from init_ps_display, but that only requires a
> >> small amount of code refactoring inside ps_status.c.
> 
> > Consider all the helper processes that set their process title.  The
> > only thing I can think of is to add a boolean to set_ps_display() so say
> > whether this is per-command set or not. Is that your idea?
> 
> No, that's not what I said at all.  Currently init_ps_display doesn't
> actually force the display to update; it's left to the first
> set_ps_display call to do that.  If we made init_ps_display update the
> status unconditionally, then set_ps_display could be a conditional
> no-op, and in the helper process setup code
> 
> 	/* Identify myself via ps */
> 	init_ps_display("autovacuum process", "", "");
> 	set_ps_display("");
> 
> we could remove the now-unnecessary set_ps_display("") calls, but
> the other set_ps_display() calls would stay exactly like they are.

Yea, I figured that out the merge idea after I replied.  

If you put a contition test in set_ps_display(), the only clean way to
do this is for init_ps_display() to force update_process_title to true
before we call set_ps_display(), then reset it to its original value,
but that sounds pretty ugly.  Do we create another function that
unconditionally sets the title, and conditionally call that from the
set_ps_display()? These seem uglier than the if() test.  Or add a
'force' parameter.

-- 
  Bruce Momjian   bruce(at)momjian(dot)us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2006-06-26 21:59:49
Subject: Re: [PATCHES] Non-transactional pg_class, try 2
Previous:From: Oleg BartunovDate: 2006-06-26 21:48:13
Subject: Re: GIN index creation extremely slow ?

pgsql-patches by date

Next:From: Simon RiggsDate: 2006-06-26 21:59:49
Subject: Re: [PATCHES] Non-transactional pg_class, try 2
Previous:From: Tom LaneDate: 2006-06-26 21:43:22
Subject: Re: [HACKERS] Overhead for stats_command_string et al, take 2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group