Re: BUG #17336: logtape sort performance and overflow
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ma100@hotmail.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2021-12-14T16:28:07Z
Lists: pgsql-bugs
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
Commits
-
Improve sift up/down code in binaryheap.c and logtape.c.
- a2ff18e89ff8 15.0 landed
-
Fix datatype confusion in logtape.c's right_offset().
- 0a5682041dbf 13.6 landed
- 25c7faa1feee 14.2 landed
- 2de3c1015cb2 15.0 landed