pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Split out tiebreaker comparisons from comparetup_* functions
6+ messages / 4 participants
[nested] [flat]

* pgsql: Split out tiebreaker comparisons from comparetup_* functions
@ 2023-08-16 10:17  John Naylor <john.naylor@postgresql.org>
  0 siblings, 1 reply; 6+ messages in thread

From: John Naylor @ 2023-08-16 10:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Split out tiebreaker comparisons from comparetup_* functions

Previously, if a specialized comparator found equal datum1 keys,
the "comparetup" function would repeat the comparison on the
datum before proceeding with the unabbreviated first key
and/or additional sort keys.

Move comparing additional sort keys into "tiebreak" functions so
that specialized comparators can call these directly if needed,
avoiding duplicate work.

Reviewed by David Rowley

Discussion: https://postgr.es/m/CAFBsxsGaVfUrjTghpf%3DkDBYY%3DjWx1PN-fuusVe7Vw5s0XqGdGw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c9bfa40914be4a0882b904834c2bd32775a50d7b

Modified Files
--------------
src/backend/utils/sort/tuplesort.c         |   9 +--
src/backend/utils/sort/tuplesortvariants.c | 125 ++++++++++++++++++++++-------
src/include/utils/tuplesort.h              |   7 ++
3 files changed, 108 insertions(+), 33 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Split out tiebreaker comparisons from comparetup_* functions
@ 2023-08-17 04:41  John Naylor <john.naylor@enterprisedb.com>
  parent: John Naylor <john.naylor@postgresql.org>
  0 siblings, 1 reply; 6+ messages in thread

From: John Naylor @ 2023-08-17 04:41 UTC (permalink / raw)
  To: John Naylor <john.naylor@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

On Wed, Aug 16, 2023 at 5:17 PM John Naylor <john.naylor@postgresql.org>
wrote:
>
> Split out tiebreaker comparisons from comparetup_* functions

Hammerkop is getting OOM errors with this change. Most grand totals in the
memory context stats show between 1 and 3 MB, and "tuplesort main" only
shows small-ish requests, so not sure what's going on.

--
John Naylor
EDB: http://www.enterprisedb.com

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Split out tiebreaker comparisons from comparetup_* functions
@ 2023-08-17 12:47  John Naylor <john.naylor@enterprisedb.com>
  parent: John Naylor <john.naylor@enterprisedb.com>
  0 siblings, 1 reply; 6+ messages in thread

From: John Naylor @ 2023-08-17 12:47 UTC (permalink / raw)
  To: John Naylor <john.naylor@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

On Thu, Aug 17, 2023 at 11:41 AM John Naylor <john.naylor@enterprisedb.com>
wrote:
>
>
> On Wed, Aug 16, 2023 at 5:17 PM John Naylor <john.naylor@postgresql.org>
wrote:
> >
> > Split out tiebreaker comparisons from comparetup_* functions
>
> Hammerkop is getting OOM errors with this change. Most grand totals in
the memory context stats show between 1 and 3 MB, and "tuplesort main" only
shows small-ish requests, so not sure what's going on.

That remains the only new failure in the buildfarm, and it just failed in
the same way again. I'll try to figure out what could be the cause, but if
I don't I'll revert within 24 hours.

--
John Naylor
EDB: http://www.enterprisedb.com

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Split out tiebreaker comparisons from comparetup_* functions
@ 2023-08-18 10:25  Thomas Munro <thomas.munro@gmail.com>
  parent: John Naylor <john.naylor@enterprisedb.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Thomas Munro @ 2023-08-18 10:25 UTC (permalink / raw)
  To: John Naylor <john.naylor@enterprisedb.com>; +Cc: John Naylor <john.naylor@postgresql.org>; pgsql-committers@lists.postgresql.org

On Fri, Aug 18, 2023 at 12:48 AM John Naylor
<john.naylor@enterprisedb.com> wrote:
> On Thu, Aug 17, 2023 at 11:41 AM John Naylor <john.naylor@enterprisedb.com> wrote:
> > On Wed, Aug 16, 2023 at 5:17 PM John Naylor <john.naylor@postgresql.org> wrote:
> > >
> > > Split out tiebreaker comparisons from comparetup_* functions
> >
> > Hammerkop is getting OOM errors with this change. Most grand totals in the memory context stats show between 1 and 3 MB, and "tuplesort main" only shows small-ish requests, so not sure what's going on.
>
> That remains the only new failure in the buildfarm, and it just failed in the same way again. I'll try to figure out what could be the cause, but if I don't I'll revert within 24 hours.

I don't know what's going on on that machine but those two failures
seem different, and there are also now some failures in release
branches that don't have your commit, so I'd wait long for more
evidence...





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Split out tiebreaker comparisons from comparetup_* functions
@ 2023-08-18 10:57  John Naylor <john.naylor@enterprisedb.com>
  parent: Thomas Munro <thomas.munro@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: John Naylor @ 2023-08-18 10:57 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@gmail.com>; +Cc: John Naylor <john.naylor@postgresql.org>; pgsql-committers@lists.postgresql.org

On Fri, Aug 18, 2023 at 5:26 PM Thomas Munro <thomas.munro@gmail.com> wrote:
>
> > > Hammerkop is getting OOM errors with this change. Most grand totals
in the memory context stats show between 1 and 3 MB, and "tuplesort main"
only shows small-ish requests, so not sure what's going on.
> >
> > That remains the only new failure in the buildfarm, and it just failed
in the same way again. I'll try to figure out what could be the cause, but
if I don't I'll revert within 24 hours.
>
> I don't know what's going on on that machine but those two failures
> seem different, and there are also now some failures in release
> branches that don't have your commit, so I'd wait long for more
> evidence...

Ah, I did check at least one back branch yesterday and didn't see any
failures then. I see them now, thanks!

(FWIW, I've been looking for signs of memory malfeasance in the commit, and
found nothing yet)

--
John Naylor
EDB: http://www.enterprisedb.com

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Split out tiebreaker comparisons from comparetup_* functions
@ 2023-08-18 14:58  Tom Lane <tgl@sss.pgh.pa.us>
  parent: John Naylor <john.naylor@enterprisedb.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-08-18 14:58 UTC (permalink / raw)
  To: John Naylor <john.naylor@enterprisedb.com>; +Cc: Thomas Munro <thomas.munro@gmail.com>; John Naylor <john.naylor@postgresql.org>; pgsql-committers@lists.postgresql.org

John Naylor <john.naylor@enterprisedb.com> writes:
> On Fri, Aug 18, 2023 at 5:26 PM Thomas Munro <thomas.munro@gmail.com> wrote:
>> I don't know what's going on on that machine but those two failures
>> seem different, and there are also now some failures in release
>> branches that don't have your commit, so I'd wait long for more
>> evidence...

> Ah, I did check at least one back branch yesterday and didn't see any
> failures then. I see them now, thanks!

... and hamerkop just went back to green on HEAD.  So whatever is up
with that machine, it's not the fault of your commit.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2023-08-18 14:58 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-08-16 10:17 pgsql: Split out tiebreaker comparisons from comparetup_* functions John Naylor <john.naylor@postgresql.org>
2023-08-17 04:41 ` John Naylor <john.naylor@enterprisedb.com>
2023-08-17 12:47   ` John Naylor <john.naylor@enterprisedb.com>
2023-08-18 10:25     ` Thomas Munro <thomas.munro@gmail.com>
2023-08-18 10:57       ` John Naylor <john.naylor@enterprisedb.com>
2023-08-18 14:58         ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox