Re: trivial patch for dynahash logging - Mailing list pgsql-hackers

From Tom Lane
Subject Re: trivial patch for dynahash logging
Date
Msg-id 9208.1411855745@sss.pgh.pa.us
Whole thread Raw
In response to trivial patch for dynahash logging  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: trivial patch for dynahash logging
List pgsql-hackers
Jeff Janes <jeff.janes@gmail.com> writes:
> under HASH_STATISTICS, the output reporting "this HTAB" upon destruction is
> pretty useless. Which HTAB would this one be?  It is not necessarily the
> most recently created one.

> This makes it output the %p to the actual HTAB, so it can be matched up
> with the logging of the creation.

Seems reasonable, although I wonder why neither of them print the tabname
string.  More generally, I see no calls to hash_stats() anywhere except
in hash_destroy(), so wouldn't you need a rather larger patch to make it
actually do anything useful?

> I'm not sure why it bypasses elog.  Is that so it can run during start-up
> before elog is active?  I'd like to make it go through elog so that
> log_line_prefix are applied, but then it would no longer be a trivial patch.

A quick dig in our git history shows that it was like that in Postgres95,
so the answer is most likely "this code predates elog()".  I would think
it'd be a safe assumption that elog is initialized before any hashtables
are created, but certainly you could test that pretty quickly ...
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: trivial patch for dynahash logging
Next
From: Peter Geoghegan
Date:
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}