Re: visibility maps and heap_prune

Lists: pgsql-hackers
From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: visibility maps and heap_prune
Date: 2008-12-05 06:57:47
Message-ID: 2e78013d0812042257x175e5a45w5edeaff14f7249ac@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

ISTM that the PD_ALL_VISIBLE flag and the visibility map bit can be set at
the end of pruning operation if we know that there are only tuples visible
to all transactions left in the page. The way pruning is done, I think it
would be straight forward to get this information.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2008-12-06 14:38:02
Message-ID: 493A8E4A.2000405@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavan Deolasee wrote:
> ISTM that the PD_ALL_VISIBLE flag and the visibility map bit can be set at
> the end of pruning operation if we know that there are only tuples visible
> to all transactions left in the page.

Right.

> The way pruning is done, I think it
> would be straight forward to get this information.

Is it? I thought about that a bit while writing the patch, but didn't
see any obvious way to do it. Except by adding a loop through all tuples
on the page, but that's extra overhead. I think we're looping through
all tuples in the pruning, but it's not quite obvious.

If you see a straightforward way, please submit a patch!

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2008-12-08 06:03:00
Message-ID: 2e78013d0812072203p3b69bbf1h5fd1650f05277c26@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Dec 6, 2008 at 8:08 PM, Heikki Linnakangas <
heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:

>
> If you see a straightforward way, please submit a patch!
>
>
Will do that.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com


From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2008-12-08 12:56:49
Message-ID: 2e78013d0812080456s2158fc9ex30f90250a3eadd5c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Dec 8, 2008 at 11:33 AM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>wrote:

>
>
> On Sat, Dec 6, 2008 at 8:08 PM, Heikki Linnakangas <
> heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>
>>
>> If you see a straightforward way, please submit a patch!
>>
>>
> Will do that.
>
>

Here is a patch which implements this. The PD_ALL_VISIBLE flag is set if all
tuples in the page are visible to all transactions and there are no DEAD
line pointers in the page. The second check is required so that VACUUM takes
up the page. We could slightly distinguish the two cases (one where the page
requires vacuuming only because of DEAD line pointers and the other where
the page-tuples do not require any visibility checks), but I thought its not
worth the complexity.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
visibility_maps_prune.patch text/x-patch 7.2 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-01-15 01:40:59
Message-ID: 200901150140.n0F1exD12180@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Is this something for 8.4 CVS?

---------------------------------------------------------------------------

Pavan Deolasee wrote:
> On Mon, Dec 8, 2008 at 11:33 AM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>wrote:
>
> >
> >
> > On Sat, Dec 6, 2008 at 8:08 PM, Heikki Linnakangas <
> > heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> >
> >>
> >> If you see a straightforward way, please submit a patch!
> >>
> >>
> > Will do that.
> >
> >
>
> Here is a patch which implements this. The PD_ALL_VISIBLE flag is set if all
> tuples in the page are visible to all transactions and there are no DEAD
> line pointers in the page. The second check is required so that VACUUM takes
> up the page. We could slightly distinguish the two cases (one where the page
> requires vacuuming only because of DEAD line pointers and the other where
> the page-tuples do not require any visibility checks), but I thought its not
> worth the complexity.
>
> Thanks,
> Pavan
>
> --
> Pavan Deolasee
> EnterpriseDB http://www.enterprisedb.com

[ Attachment, skipping... ]

>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

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

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


From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-01-15 16:48:25
Message-ID: 2e78013d0901150848g1dffcc04r49af607f5999a49e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jan 15, 2009 at 7:10 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> Is this something for 8.4 CVS?
>

I worked out the patch as per Heikki's suggestion. So I think he needs
to review and decide it's fate.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-01-15 16:55:42
Message-ID: 496F6A8E.8020908@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavan Deolasee wrote:
> On Thu, Jan 15, 2009 at 7:10 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>> Is this something for 8.4 CVS?
>
> I worked out the patch as per Heikki's suggestion. So I think he needs
> to review and decide it's fate.

Yeah, I dropped the ball on that one. It's been knocking in the back of
my head since, but I've never gotten around. I'm feeling reluctant to
review it since it's not really a high priority thing, and I'm not sure
whether we want it or not.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: "Robert Haas" <robertmhaas(at)gmail(dot)com>
To: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-01-15 17:28:35
Message-ID: 603c8f070901150928v530d3925tdaadc7eb47be9e60@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> Yeah, I dropped the ball on that one. It's been knocking in the back of my
> head since, but I've never gotten around. I'm feeling reluctant to review it
> since it's not really a high priority thing, and I'm not sure whether we
> want it or not.

In that case perhaps we should add it to
http://wiki.postgresql.org/wiki/CommitFest_2009-First and let it go
for 8.4.

...Robert


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-01-20 16:49:51
Message-ID: 200901201649.n0KGnpS18240@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavan Deolasee wrote:
> On Mon, Dec 8, 2008 at 11:33 AM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>wrote:
>
> >
> >
> > On Sat, Dec 6, 2008 at 8:08 PM, Heikki Linnakangas <
> > heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> >
> >>
> >> If you see a straightforward way, please submit a patch!
> >>
> >>
> > Will do that.
> >
> >
>
> Here is a patch which implements this. The PD_ALL_VISIBLE flag is set if all
> tuples in the page are visible to all transactions and there are no DEAD
> line pointers in the page. The second check is required so that VACUUM takes
> up the page. We could slightly distinguish the two cases (one where the page
> requires vacuuming only because of DEAD line pointers and the other where
> the page-tuples do not require any visibility checks), but I thought its not
> worth the complexity.

Is this patch for 8.4?

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

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


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-01-20 17:04:31
Message-ID: 4976041F.1070707@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> Pavan Deolasee wrote:
>> On Mon, Dec 8, 2008 at 11:33 AM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>wrote:
>>
>>>
>>> On Sat, Dec 6, 2008 at 8:08 PM, Heikki Linnakangas <
>>> heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>>>
>>>> If you see a straightforward way, please submit a patch!
>>>>
>>>>
>>> Will do that.
>>>
>>>
>> Here is a patch which implements this. The PD_ALL_VISIBLE flag is set if all
>> tuples in the page are visible to all transactions and there are no DEAD
>> line pointers in the page. The second check is required so that VACUUM takes
>> up the page. We could slightly distinguish the two cases (one where the page
>> requires vacuuming only because of DEAD line pointers and the other where
>> the page-tuples do not require any visibility checks), but I thought its not
>> worth the complexity.
>
> Is this patch for 8.4?

We already went through this:

http://archives.postgresql.org/message-id/496F6A8E.8020908@enterprisedb.com

I guess I'll follow Robert's advice and add this to the first 8.5 commit
fest page.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-07-16 03:44:34
Message-ID: 34d269d40907152044s46a5a810paca5dedf8d13bedf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Dec 8, 2008 at 06:56, Pavan Deolasee<pavan(dot)deolasee(at)gmail(dot)com> wrote:
> Here is a patch which implements this. The PD_ALL_VISIBLE flag is set if all
> tuples in the page are visible to all transactions and there are no DEAD
> line pointers in the page. The second check is required so that VACUUM takes
> up the page. We could slightly distinguish the two cases (one where the page
> requires vacuuming only because of DEAD line pointers and the other where
> the page-tuples do not require any visibility checks), but I thought its not
> worth the complexity.

Hi!

I was round robin assigned to review this. So take my comments with
the grain of salt (or novice HOT salt) they deserve.

I did some quick performance testing that basically boiled down to:
insert
(hot) update
select

to see if I could detect any noticeable performance difference (see
attachments for more detail for exact queries ran, all run with
autovac off).

The only major difference was with this patch vacuum time (after the
first select after some hot updates) was significantly reduced for my
test case (366ms vs 16494ms).

There was no noticeable (within noise) select or update slow down.

I was able to trigger WARNING: PD_ALL_VISIBLE flag once while running
pgbench but have not be able to re-create it... (should I keep
trying?)

See comments on patch below...

>Index: src/backend/access/heap/pruneheap.c

<snip>

>*************** heap_page_prune_opt(Relation relation, B
>*** 118,125 ****
> (void) heap_page_prune(relation, buffer, OldestXmin, false, true);
> }
>
>! /* And release buffer lock */
>! LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
> }
> }
>
>--- 124,150 ----
> (void) heap_page_prune(relation, buffer, OldestXmin, false, true);
> }
>
>! /*
>! * Since the visibility map page may require an I/O,release the buffer
>! * lock before updating the visibility map.
>! */

Would it be worth having heap_page_prune() return or pass in a ptr so
we can saw we need to update the visibility map because we set/changed
PageIsAllVisible?

>! if (PageIsAllVisible(page))
>! {
>! Buffer vmbuffer = InvalidBuffer;
>! /* Release buffer lock */
>! LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
>!
>! visibilitymap_pin(relation, BufferGetBlockNumber(buffer), &vmbuffer);
>! LockBuffer(buffer, BUFFER_LOCK_SHARE);
>! if (PageIsAllVisible(page))
>! visibilitymap_set(relation, BufferGetBlockNumber(buffer),
>! PageGetLSN(page), &vmbuffer);
>! LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
>! if (BufferIsValid(vmbuffer))
>! ReleaseBuffer(vmbuffer);
>! }
>! else
>! LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
> }
> }
>

<snip>

>*************** heap_page_prune(Relation relation, Buffe
>*** 245,250 ****
>--- 277,291 ----
> */
> PageClearFull(page);
>
>+ /* Update the all-visible flag on the page */
>+ if (!PageIsAllVisible(page) && prstate.all_visible)
>+ PageSetAllVisible(page);
>+ else if (PageIsAllVisible(page) && !prstate.all_visible)
>+ {
>+ elog(WARNING, "PD_ALL_VISIBLE flag was incorrectly set");
>+ PageClearAllVisible(page);

Hrm do we need to update the visibility map ? AFAICT this wont update
it it because we only check for PageIsAllVisible() in
heap_page_prune_opt().

>+ }
>+
> MarkBufferDirty(buffer);
>
> /*
>*************** heap_page_prune(Relation relation, Buffe
>*** 282,287 ****
>--- 323,341 ----
> PageClearFull(page);
> SetBufferCommitInfoNeedsSave(buffer);
> }
>+
>+ /* Update the all-visible flag on the page */
>+ if (!PageIsAllVisible(page) && prstate.all_visible)
>+ {
>+ PageSetAllVisible(page);
>+ SetBufferCommitInfoNeedsSave(buffer);
>+ }
>+ else if (PageIsAllVisible(page) && !prstate.all_visible)
>+ {
>+ elog(WARNING, "PD_ALL_VISIBLE flag was incorrectly set");
>+ PageClearAllVisible(page);
>+ SetBufferCommitInfoNeedsSave(buffer);

Same question as above.

>+ }
> }
>
> END_CRIT_SECTION();

<snip>

>*************** heap_prune_chain(Relation relation, Buff
>*** 495,503 ****
>--- 557,596 ----
> */
> heap_prune_record_prunable(prstate,
> HeapTupleHeaderGetXmax(htup));
>+ prstate->all_visible = false;
> break;
>
> case HEAPTUPLE_LIVE:
>+ /*
>+ * Is the tuple definitely visible to all transactions?
>+ *
>+ * NB: Like with per-tuple hint bits, we can't set the
>+ * PD_ALL_VISIBLE flag if the inserter committed
>+ * asynchronously. See SetHintBits for more info. Check
>+ * that the HEAP_XMIN_COMMITTED hint bit is set because of
>+ * that.
>+ */
>+ if (prstate->all_visible)
>+ {
>+ TransactionId xmin;
>+
>+ if (!(htup->t_infomask & HEAP_XMIN_COMMITTED))
>+ {
>+ prstate->all_visible = false;
>+ break;
>+ }
>+ /*
>+ * The inserter definitely committed. But is it
>+ * old enough that everyone sees it as committed?
>+ */
>+ xmin = HeapTupleHeaderGetXmin(htup);
>+ if (!TransactionIdPrecedes(xmin, OldestXmin))
>+ {
>+ prstate->all_visible = false;
>+ break;
>+ }
>+ }
>+ break;

(nitpick) missing newline

> case HEAPTUPLE_INSERT_IN_PROGRESS:
>
> /*>

Attachment Content-Type Size
cvs_head_bench application/octet-stream 3.9 KB
pd_all_vis_bench application/octet-stream 3.9 KB
bench.sql application/octet-stream 1.8 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alex Hunsaker <badalex(at)gmail(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-07-21 05:08:35
Message-ID: 603c8f070907202208i7bdce7bapd2f4e58cfc65e682@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jul 15, 2009 at 11:44 PM, Alex Hunsaker<badalex(at)gmail(dot)com> wrote:
> On Mon, Dec 8, 2008 at 06:56, Pavan Deolasee<pavan(dot)deolasee(at)gmail(dot)com> wrote:
>> Here is a patch which implements this. The PD_ALL_VISIBLE flag is set if all
>> tuples in the page are visible to all transactions and there are no DEAD
>> line pointers in the page. The second check is required so that VACUUM takes
>> up the page. We could slightly distinguish the two cases (one where the page
>> requires vacuuming only because of DEAD line pointers and the other where
>> the page-tuples do not require any visibility checks), but I thought its not
>> worth the complexity.
>
> Hi!
>
> I was round robin assigned to review this.  So take my comments with
> the grain of salt (or novice HOT salt) they deserve.

Pavan, are you planning to respond to Alex's comments and/or update this patch?

...Robert


From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alex Hunsaker <badalex(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-07-21 06:37:35
Message-ID: 2e78013d0907202337h7c2a3eb1sa553aa5dd3c7325a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jul 21, 2009 at 10:38 AM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:

>
> Pavan, are you planning to respond to Alex's comments and/or update this patch?
>

Yes, I will. Hopefully by end of this week.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Alex Hunsaker <badalex(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2009-07-25 21:51:12
Message-ID: 603c8f070907251451l4d839bbfq68da642f366564eb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jul 21, 2009 at 2:37 AM, Pavan Deolasee<pavan(dot)deolasee(at)gmail(dot)com> wrote:
> On Tue, Jul 21, 2009 at 10:38 AM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
>> Pavan, are you planning to respond to Alex's comments and/or update this patch?
>
> Yes, I will. Hopefully  by end of this week.

Since it has now been 10 days since this patch was reviewed, I think
that it is more than fair to move this from "Waiting on Author" to
"Returned with Feedback". As I've said on other threads, we want to
give everyone a fair chance to respond to review comments, but we also
don't want to tie up reviewers indefinitely on patches that aren't
being updated in a timely fashion, and we don't want to be left with a
crush of patches that need to be re-reviewed at the very end of the
CommitFest when suddenly everyone updates them. So I'm going to go
make this change.

I hope, though, that this will be resubmitted, after appropriate
updating, for a future CommitFest. I haven't read the code so I can't
speak at all to whether it works (in which I'm including crash-safe,
deadlock-proof, and correct with respect to locking), but if so it
sounds like a nice improvement.

Thanks,

...Robert


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2010-02-26 02:49:10
Message-ID: 201002260249.o1Q2nAB04502@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Whatever happened to this? It was in the first 9.0 commitfest but was
returned with feedback but never updated:

https://commitfest.postgresql.org/action/patch_view?id=75

---------------------------------------------------------------------------

Pavan Deolasee wrote:
> ISTM that the PD_ALL_VISIBLE flag and the visibility map bit can be set at
> the end of pruning operation if we know that there are only tuples visible
> to all transactions left in the page. The way pruning is done, I think it
> would be straight forward to get this information.
>
> Thanks,
> Pavan
>
> --
> Pavan Deolasee
> EnterpriseDB http://www.enterprisedb.com

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2010-02-26 03:29:29
Message-ID: 603c8f071002251929p75799beeqc9835d34e19ae6cb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Feb 25, 2010 at 9:49 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Whatever happened to this?  It was in the first 9.0 commitfest but was
> returned with feedback but never updated:
>
>        https://commitfest.postgresql.org/action/patch_view?id=75

Well, the patch author chose not to pursue it. It's clearly far too
late now, at least for 9.0.

I'm pleased to see that you're not finding many patches that just
completely slipped through the cracks - seems like most things were
withdrawn on purpose, had problems, and/or were not pursued by the
author. I think the CommitFest process has done a pretty good job of
making sure everything gets looked at. The only small chink I see is
that there may be some patches (especially small ones or from
first-time contributors) which escaped getting added to a CommitFest
in the first place; and we don't really have a way of policing that.
Usually someone replies to the patch author and suggests adding it to
the next CF, but I can't swear that that happens in every case.

...Robert


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2010-02-26 03:32:37
Message-ID: 201002260332.o1Q3Wb517645@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas wrote:
> On Thu, Feb 25, 2010 at 9:49 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > Whatever happened to this? ?It was in the first 9.0 commitfest but was
> > returned with feedback but never updated:
> >
> > ? ? ? ?https://commitfest.postgresql.org/action/patch_view?id=75
>
> Well, the patch author chose not to pursue it. It's clearly far too
> late now, at least for 9.0.
>
> I'm pleased to see that you're not finding many patches that just
> completely slipped through the cracks - seems like most things were
> withdrawn on purpose, had problems, and/or were not pursued by the
> author. I think the CommitFest process has done a pretty good job of
> making sure everything gets looked at. The only small chink I see is
> that there may be some patches (especially small ones or from
> first-time contributors) which escaped getting added to a CommitFest
> in the first place; and we don't really have a way of policing that.
> Usually someone replies to the patch author and suggests adding it to
> the next CF, but I can't swear that that happens in every case.

Yea, the complex issues are often lost, and I stopped tracking
commitfest items so I don't actually know if anything that got into the
commit fest was eventually just dropped by the author. We can say we
don't need to persue those but they might be valuable/important.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2010-02-26 03:47:23
Message-ID: 603c8f071002251947l42683e1ey6fb3bee0e0226797@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Feb 25, 2010 at 10:32 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Robert Haas wrote:
>> On Thu, Feb 25, 2010 at 9:49 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>> > Whatever happened to this? ?It was in the first 9.0 commitfest but was
>> > returned with feedback but never updated:
>> >
>> > ? ? ? ?https://commitfest.postgresql.org/action/patch_view?id=75
>>
>> Well, the patch author chose not to pursue it.  It's clearly far too
>> late now, at least for 9.0.
>>
>> I'm pleased to see that you're not finding many patches that just
>> completely slipped through the cracks - seems like most things were
>> withdrawn on purpose, had problems, and/or were not pursued by the
>> author.  I think the CommitFest process has done a pretty good job of
>> making sure everything gets looked at.  The only small chink I see is
>> that there may be some patches (especially small ones or from
>> first-time contributors) which escaped getting added to a CommitFest
>> in the first place; and we don't really have a way of policing that.
>> Usually someone replies to the patch author and suggests adding it to
>> the next CF, but I can't swear that that happens in every case.
>
> Yea, the complex issues are often lost, and I stopped tracking
> commitfest items so I don't actually know if anything that got into the
> commit fest was eventually just dropped by the author.  We can say we
> don't need to persue those but they might be valuable/important.

Yes, they could be valuable/important - anything that falls into that
category is probably going to turn into a TODO list item at this
point.

...Robert


From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps and heap_prune
Date: 2010-02-26 04:19:47
Message-ID: 2e78013d1002252019t5db841f2v9663ea3636dc4c69@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Feb 26, 2010 at 8:19 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

>
> Whatever happened to this? It was in the first 9.0 commitfest but was
> returned with feedback but never updated:
>
>
Though Alex did some useful tests and review, and in fact confirmed that the
VACUUM time dropped from 16494 msec to 366 msec, I somehow kept waiting for
Heikki's decision on the general direction of the patch and lost interest in
between. If we are still interested in this, I can work out a patch and
submit for next release if not this.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: "pgsql-hackers"(at)momjian(dot)us, pgsql-hackers(at)postgresql(dot)org, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Subject: Re: visibility maps and heap_prune
Date: 2010-02-27 02:52:20
Message-ID: 201002270252.o1R2qKh09403@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavan Deolasee wrote:
> On Fri, Feb 26, 2010 at 8:19 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> >
> > Whatever happened to this? It was in the first 9.0 commitfest but was
> > returned with feedback but never updated:
> >
> >
> Though Alex did some useful tests and review, and in fact confirmed that the
> VACUUM time dropped from 16494 msec to 366 msec, I somehow kept waiting for
> Heikki's decision on the general direction of the patch and lost interest in
> between. If we are still interested in this, I can work out a patch and
> submit for next release if not this.

OK, TODO added:

Have single-page pruning update the visibility map
* https://commitfest.postgresql.org/action/patch_view?id=75

Hopefully Heikki can comment on this.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)momjian(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: visibility maps and heap_prune
Date: 2010-02-27 09:00:42
Message-ID: 4B88DF3A.1060604@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> Pavan Deolasee wrote:
>> On Fri, Feb 26, 2010 at 8:19 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>>
>>> Whatever happened to this? It was in the first 9.0 commitfest but was
>>> returned with feedback but never updated:
>>>
>>>
>> Though Alex did some useful tests and review, and in fact confirmed that the
>> VACUUM time dropped from 16494 msec to 366 msec, I somehow kept waiting for
>> Heikki's decision on the general direction of the patch and lost interest in
>> between. If we are still interested in this, I can work out a patch and
>> submit for next release if not this.
>
> OK, TODO added:
>
> Have single-page pruning update the visibility map
> * https://commitfest.postgresql.org/action/patch_view?id=75
>
> Hopefully Heikki can comment on this.

I think I was worried about the possible performance impact of having to
clear the bit in visibility map again. If you're frequently updating a
tuple so that HOT and page pruning is helping you, setting the bit in
visibility map seems counter-productive; it's going to be cleared soon
again by another UPDATE. That's just a hunch, though. Maybe the overhead
is negligible.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)momjian(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: visibility maps and heap_prune
Date: 2010-02-27 14:40:17
Message-ID: 201002271440.o1REeHi12955@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Heikki Linnakangas wrote:
> Bruce Momjian wrote:
> > Pavan Deolasee wrote:
> >> On Fri, Feb 26, 2010 at 8:19 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> >>
> >>> Whatever happened to this? It was in the first 9.0 commitfest but was
> >>> returned with feedback but never updated:
> >>>
> >>>
> >> Though Alex did some useful tests and review, and in fact confirmed that the
> >> VACUUM time dropped from 16494 msec to 366 msec, I somehow kept waiting for
> >> Heikki's decision on the general direction of the patch and lost interest in
> >> between. If we are still interested in this, I can work out a patch and
> >> submit for next release if not this.
> >
> > OK, TODO added:
> >
> > Have single-page pruning update the visibility map
> > * https://commitfest.postgresql.org/action/patch_view?id=75
> >
> > Hopefully Heikki can comment on this.
>
> I think I was worried about the possible performance impact of having to
> clear the bit in visibility map again. If you're frequently updating a
> tuple so that HOT and page pruning is helping you, setting the bit in
> visibility map seems counter-productive; it's going to be cleared soon
> again by another UPDATE. That's just a hunch, though. Maybe the overhead
> is negligible.

Should I remove the TODO item? I updated the text to:

Consider having single-page pruning update the visibility map

and added a URL to Heikki's new comment.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +