Re: sqlsmith crash incremental sort

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Richard Guo <guofenglinux@gmail.com>, James Coleman <jtc331@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-04-23T14:56:42Z
Lists: pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> On Thu, Apr 23, 2020 at 03:28:21PM +0800, Richard Guo wrote:
>> A minor comment is that I don't think we need to strip relabel
>> explicitly before calling pull_varnos(), because this function would
>> recurse into T_RelabelType nodes.

> Hmmm, yeah. I think you're right that's unnecessary. I misread the
> walker function, I think.

+1, might as well simplify the code.

>> Also do we need to call bms_free(varnos) for each pathkey here to avoid
>> waste of memory?

> I don't think so. It wouldn't hurt, but we don't do that for other
> pull_vernos calls either AFAICS.

Yeah, the planner is generally pretty profligate of memory, and these
bitmaps aren't likely to be huge anyway.

			regards, tom lane



Commits

  1. Simplify cost_incremental_sort a bit

  2. Fix cost_incremental_sort for expressions with varno 0