Re: [HACKERS] Performance problem partially identified

From: Hannu Krosing <hannu(at)trust(dot)ee>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Performance problem partially identified
Date: 1999-05-28 21:19:36
Message-ID: 374F0868.1CA37640@trust.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> It looks to me like something is broken such that bufmgr.c *always*
> thinks that a buffer is dirty (and needs written out) when it is
> released.

That could also explain why the performance increases quite noticeably
even for _select_ queries when you specify "no fsync" for backend.
(I have'nt checked it lately, but it was the case about a year ago)

> Poking around for the cause, I find that heapgettup() calls
> SetBufferCommitInfoNeedsSave() for every single tuple read from the
> table:
...
> I don't understand this code well enough to fix it, but I assert that
> it's broken.

More likely this is a "quick fix - will look at it later" for something
else, praobably an execution path that fails to call
SetBufferCommitInfoNeedsSave() when needed.

Or it can be just code to check if this fixes it which has been
forgotten in.

> Most of these tuples are *not* being modified, and there
> is no reason to have to rewrite the buffer.

It can be quite a lot of work to find all the places that can modify the
tuple, even with some special tools.

Is there any tool that can report writes to areas set read only
(similar to malloc/free debuggers ?)

If there is then we can replace SetBufferCommitInfoNeedsSave()
with a macro that does both SetBufferCommitInfoNeedsSave() and allows
writing, so that we can automate the checking.

-----------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-05-28 23:08:21 Re: Performance problem partially identified
Previous Message Bruce Momjian 1999-05-28 18:41:13 Re: [HACKERS] Ye olde "relation doesn't quite exist" problem