Re: Buglets in equivclass.c

2020-10-05 Thread Tom Lane
David Rowley writes: > On Mon, 5 Oct 2020 at 06:29, Tom Lane wrote: >> I'm unsure whether to back-patch either of these. They both seem to be >> just latent bugs so far as the core code is concerned, but the first one >> in particular seems like something that could bite extension code. >> Thoug

Re: Buglets in equivclass.c

2020-10-04 Thread David Rowley
On Mon, 5 Oct 2020 at 06:29, Tom Lane wrote: > > While hacking on a patch that touches equivclass.c, I came across > a couple of things that seemed wrong, and are fixed by the attached > proposed patch. > > First, get_eclass_for_sort_expr() computes expr_relids and nullable_relids > too soon. Thi

Buglets in equivclass.c

2020-10-04 Thread Tom Lane
While hacking on a patch that touches equivclass.c, I came across a couple of things that seemed wrong, and are fixed by the attached proposed patch. First, get_eclass_for_sort_expr() computes expr_relids and nullable_relids too soon. This is a waste of a not-really-trivial number of cycles in th