Re: stats for failed transactions (was Re: [GENERAL] VACUUM

From: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Jan Wieck <JanWieck(at)Yahoo(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: stats for failed transactions (was Re: [GENERAL] VACUUM
Date: 2006-01-28 15:53:54
Message-ID: 43DB9392.3030602@zeut.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
> I'd argue it's fine: there are tons of people using row-level stats
> via autovacuum, and (AFAICT) just about nobody using 'em for any other
> purpose. Certainly you never see anyone suggesting them as a tool for
> investigating problems on pgsql-performance. Sure, it's a repurposing
> of the stats subsystem, but we should be willing to do that when field
> experience teaches us what's really needed.
>

OK.

> But all that we have is *global* counts. Inferring ratios applicable to
> particular tables seems a big stretch to me. Any given application is
> likely to have some types of transactions that roll back much more often
> than others.
>

Certainly a stretch, but it's far from fatal, the worst case scenario is
we occasionally vacuum a table that might not need it, whereas the way
things stand right now, the worst case is that we never vacuum that
might have a lot of slack space. BTW, I'm only arguing this based on
what is in the stats system now and pondering how we might improve
things if the stats system isn't changed to directly address this problem.

> One thing we could do is tie the stats message sending more tightly to
> top-level transaction commit/abort. (It's already effectively true that
> we send stats only after commit/abort, but we send 'em from the wrong
> place, ie PostgresMain.) Then the semantics of the message could be
> read as "here's what I did before committing" or "here's what I did
> before aborting" and the collector could interpret the counts
> accordingly. However, this still fails in the case where a committed
> top-level transaction includes some failed subtransactions. I think
> the only full solution will involve backends doing some extra work at
> subtransaction commit/abort so that they can report properly classified
> update counts.

Any guess as to the performance implications?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-01-28 16:04:09 Re: creating users per database
Previous Message Tom Lane 2006-01-28 15:42:45 Re: Basic questions about PQprepare()

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-01-28 16:13:36 Re: stats for failed transactions (was Re: [GENERAL] VACUUM Question)
Previous Message Tom Lane 2006-01-28 15:18:15 Re: stats for failed transactions (was Re: [GENERAL] VACUUM Question)