From: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
---|---|
To: | Heikki Linnakangas <heikki(at)enterprisedb(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: HOT patch - version 15 |
Date: | 2007-09-06 19:35:02 |
Message-ID: | 1189107302.4175.401.camel@ebony.site |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
On Thu, 2007-09-06 at 19:05 +0100, Heikki Linnakangas wrote:
> Pruning is expensive, you need to scan all tuples on
> the page and write WAL record. And defragment the page if you consider
> that part of pruning. You don't want to do it too aggressively.
OK, so my understanding or the meaning of the word has changed since we
decided that initial behaviour. So yes, not too aggressively.
Elsewhere on this thread, I said:
On Thu, 2007-09-06 at 18:05 +0100, Simon Riggs wrote:
> We could begin pruning only when the chain is N long. Currently N=2, but
> we could set N=3+ easily enough. There's no code yet to actually count
> that, but we can do that easily as we do each lookup. We should also be
> able to remember the visibility result for each tuple in the chain to
> decide whether pruning will be effective or not.
>
> I would say that if the buffer is already dirty and the chain is
> prunable, we should prune it at the first possible chance.
If we defer pruning until the page is full, worst case we may could end
up with a chain ~240 tuples long, which might need to be scanned
repeatedly. That won't happen often, but it would be better to prune
whenever we hit one of these conditions
- when the block is full
- when we reach the 16th tuple in a chain
--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-09-06 19:36:27 | Re: HOT patch - version 15 |
Previous Message | Tom Lane | 2007-09-06 19:32:07 | Re: HOT patch - version 15 |