Re: rewrite HeapSatisfiesHOTAndKey

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Pavan Deolasee <pavan(dot)deolasee(at)2ndquadrant(dot)com>
Subject: Re: rewrite HeapSatisfiesHOTAndKey
Date: 2017-01-02 05:29:59
Message-ID: CABOikdOofWGHyo_NcB3t8xBKYiU3FZ+-+1wcpx8XvGqpzD+EdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 2, 2017 at 10:17 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
wrote:

> On Mon, Jan 2, 2017 at 9:28 AM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
> wrote:
> >
> >
> > On Mon, Jan 2, 2017 at 8:52 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
> >>
> >>
> >> I think there is some chance that such a change could induce
> >> regression for the cases when there are many index columns or I think
> >> even when index is on multiple columns (consider index is on first and
> >> eight column in a ten column table).
> >>
> >
> > I don't see that as a problem because the routine only checks for columns
> > that are passed as "interesting_cols".
> >
>
> Right, but now it will evaluate for all interesting_cols whereas
> previously it would just stop at first if that column is changed.
>
>
Ah ok. I read your comment "consider index is on first and
eight column in a ten column table" as s/eight/eighth. But may be you're
referring to
the case where there is an index on eight or nine columns of a ten column
table.

You're right. That's an additional cost as Alvaro himself explained in the
original
post. But both indirect indexes and WARM needs to know information about all
modified columns. So assuming either of these patches are going to make it,
we've to bear that cost. Having said that, given that attributes are
usually cached,
the cost may not be significant since for non-HOT updates, the
attributes will be later fetched anyways while preparing index tuples. So
we're
probably doing that work in advance.

Obviously, I'm not against doing additional performance tests to ensure
that the
cost is not significant, especially if neither indirect indexes nor WARM
gets
committed in 10.0

Thanks,
Pavan
--
Pavan Deolasee http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-01-02 05:44:58 Odd behavior with PG_TRY
Previous Message Amit Kapila 2017-01-02 04:47:47 Re: rewrite HeapSatisfiesHOTAndKey