Re: Patch to fix FK-related selectivity estimates with constants

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: Re: Patch to fix FK-related selectivity estimates with constants
Date: 2020-10-28 16:13:05
Message-ID: 20201028161305.GA27924@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Oct-28, Tom Lane wrote:

> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:

> > I think if a struct is used as a function argument somewhere or arrays
> > of the struct are formed, then it's certain that changing that struct's
> > size is going to cause problems.
>
> I grasp the point about arrays, but not sure how it's a problem for
> function arguments per se? Or were you thinking of functions that
> take a struct as pass-by-value not pass-by-reference?

Yeah, pass-by-value. As you say we don't do that with Node structs, but
there are some other structs that are sometimes passed by value. It's
certainly not a common problem though.

> The way I've generally thought about this is that new fields added to the
> end of a Node struct are only likely to be a hazard if extension code
> creates new instances of that Node type. If it does, it's certainly
> problematic, first because makeNode() will allocate the wrong amount of
> storage (ABI issue) and second because the extension won't know it needs
> to fill the new fields (API issue).

Right.

> As you say, we can also search to see if there seem to be any extensions
> using the struct in question. I don't have a huge amount of faith in
> that, because I think there are lots of proprietary/custom extensions
> that aren't visible on the net. But on the other hand, the users
> of such extensions probably wouldn't have much trouble rebuilding them
> for a new version, if they did get bit. It's the widely distributed
> extensions that might have users not capable of dealing with that.

In practice, at 2ndQuadrant we've had trouble a couple of times with ABI
breaks -- certain situations can become crasher bugs, to which some
customers are extremely sensitive.

I've added a link to your message to the wiki here:
https://wiki.postgresql.org/wiki/Committing_checklist#Maintaining_ABI_compatibility_while_backpatching

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2020-10-28 16:14:48 Re: Log message for GSS connection is missing once connection authorization is successful.
Previous Message Tom Lane 2020-10-28 15:57:29 Re: Patch to fix FK-related selectivity estimates with constants