Re: Free indexed_tlist memory explicitly within set_plan_refs() - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Free indexed_tlist memory explicitly within set_plan_refs()
Date
Msg-id CAM3SWZSHNjJzA676LgvxKYV4mm0SmqbDZ4=Jh=bBK8JyBapHgg@mail.gmail.com
Whole thread Raw
In response to Re: Free indexed_tlist memory explicitly within set_plan_refs()  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Fri, Jul 24, 2015 at 3:08 AM, Andres Freund <andres@anarazel.de> wrote:
>> +             else
>> +             {
>> +                     Node       *nattExpr = list_nth(idxExprs, (natt - 1) - nplain);
>> +
>> +                     /*
>> +                      * Note that unlike routines like match_index_to_operand(), we're
>> +                      * unconcerned about RelabelType.  An exact match is required.
>> +                      */
>> +                     if (equal(elem->expr, nattExpr))
>> +                             return true;
>
> Why is that?

No very strong reason. RelabelType exists to represent a dummy
coercion between two binary-compatible types. I think that a unique
index inference specification (which is novel in some ways) does not
need to do anything special for this case.

Each inference specification attribute that is an expression should
match some attribute in some index's cataloged definition. The
inference specification looks very much like the CREATE UNIQUE INDEX
that created the unique index that is inferred (usually, they'll be
identical). No need to make it any more complicated than that.

In fact, I don't think it's possible to construct a case where it
could even be argued that it matters. I'm not very caffeinated at the
moment, so I'm not sure of that.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Proposal for CSN based snapshots
Next
From: Robert Haas
Date:
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive