Re: REPLICA IDENTITY FULL - Mailing list pgsql-hackers

From Noah Misch
Subject Re: REPLICA IDENTITY FULL
Date
Msg-id 20171205031556.GA3265701@rfd.leadboat.com
Whole thread Raw
In response to Re: [HACKERS] REPLICA IDENTITY FULL  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: REPLICA IDENTITY FULL  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On Fri, Jun 23, 2017 at 03:45:48PM -0400, Peter Eisentraut wrote:
> On 6/23/17 13:14, Alvaro Herrera wrote:
> > Andres Freund wrote:
> >> On 2017-06-23 13:05:21 -0400, Alvaro Herrera wrote:
> >>> Tom Lane wrote:
> >>>> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> >>>>> Any thoughts about keeping datumAsEqual() as a first check?  I did some
> >>>>> light performance tests, but it was inconclusive.
> >>>>
> >>>> Seems like it would tend to be a win if, in fact, the values are
> >>>> usually equal.  If they're usually not, then it's a loser.  Do
> >>>> we have any feeling for which case is more common?
> >>
> >> Seems like a premature optimization to me - if you care about
> >> performance and do this frequently, you're not going to end up using
> >> FULL.  If we want to performance optimize, it'd probably better to
> >> lookup candidate keys and use those if available.
> > 
> > I can get behind that argument.
> 
> Thanks for the feedback.  I have committed it after removing the
> datumIsEqual() call.

While reviewing this patch, I noticed a couple of nearby defects:

- RelationFindReplTupleSeq() says "Note that this stops on the first matching
  tuple.", but that's not the case.  It visits every row in the table, and it
  uses the last match.  The claimed behavior sounds more attractive.

- RelationFindReplTupleSeq() has comment "/* Start an index scan. */", an
  inapplicable copy-paste from RelationFindReplTupleByIndex().


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: ExplainOneQuery_hook ignored for EXPLAIN EXECUTE
Next
From: Amit Kapila
Date:
Subject: Usage of epoch in txid_current