pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ma100@hotmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17336: logtape sort performance and overflow
Date: Tue, 14 Dec 2021 11:28:07 -0500
Message-ID: <262745.1639499287@sss.pgh.pa.us> (raw)
In-Reply-To: <17336-fc4e522d26a750fd@postgresql.org>
References: <17336-fc4e522d26a750fd@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> In logtape.c,  

> * Each  `swap_nodes`  will execute assignment statement three times, while
> we only need execute once like in tuplesort.c

Yeah, that could be improved.  I see similar coding in binaryheap.c, too.

> * right_offset(unsigned i) parameter i seemed should be `unsigned long`

Ugh, that's surely wrong.  I don't know that anyone could get to >4G entries
in this heap, but it's still wrong.

Thanks for the report!

> Here's a patch

FYI, patches tend not to survive being passed through email unless
you add 'em as attachments.

			regards, tom lane





view thread (2+ messages)

Message-ID: <262745.1639499287@sss.pgh.pa.us>
Permalink:  ../262745.1639499287@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/262745.1639499287@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ma100@hotmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17336: logtape sort performance and overflow
  In-Reply-To: <262745.1639499287@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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