Re: pgsql: Make heap TID a tiebreaker nbtree index column.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Make heap TID a tiebreaker nbtree index column.
Date: 2019-03-20 21:13:55
Message-ID: 16667.1553116435@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

I wrote:
> Yeah. My opinion is that we should just qsort the list of targets
> during DROP OWNED and be done with this. I'll post a patch shortly.

Here's one way we could do this: add a flag to performMultipleDeletions
to invoke the sort. A small problem with it is that if we sort the
ObjectAddresses in-place as this does, we really oughta remove the
"const" from that argument. (I believe compilers would probably not
realize we were cheating if we didn't, but it'd still be cheating.)
That doesn't affect any existing callers, but in future it might
prevent const-ifying something or other. Another way we could handle
this is to make dependency.c expose a separate function
"void sortObjectAddresses(ObjectAddresses *objects)", and then have
callers call that as a separate action. Not sure which I like better
... any opinions?

A preliminary check-world run finds no places where the output changes,
but I've not tried this with SELinux yet.

regards, tom lane

Attachment Content-Type Size
sort-objects-during-drop-owned-1.patch text/x-diff 3.1 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2019-03-20 21:19:25 pgsql: Add index_get_partition convenience function
Previous Message Peter Geoghegan 2019-03-20 21:06:05 pgsql: Fix spurious compiler warning in nbtxlog.c.