Re: Get more from indices. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Get more from indices.
Date
Msg-id 11242.1389128430@sss.pgh.pa.us
Whole thread Raw
In response to Re: Get more from indices.  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: Get more from indices.  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
> The following modification to v7 does this.

> =========
> diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c
> index 380f3ba..233e21c 100644
> --- a/src/backend/optimizer/path/pathkeys.c
> +++ b/src/backend/optimizer/path/pathkeys.c
> @@ -536,7 +536,8 @@ index_pathkeys_are_extensible(PlannerInfo *root,
>          {
>              EquivalenceMember *member = (EquivalenceMember *) lfirst(lc2);
> -            if (!bms_equal(member->em_relids, index->rel->relids))
> +            if (!bms_equal(member->em_relids, index->rel->relids) ||
> +                !IsA(member, Var))
>                  continue;
>              else
>              {
> ==========

I'm pretty sure that IsA test prevents the optimization from ever firing.

But aside from hasty typos, is there enough left of this optimization to
be worth the complication?
        regards, tom lane



pgsql-hackers by date:

Previous
From: AK
Date:
Subject: Re: How to reproduce serialization failure for a read only transaction.
Next
From: Alvaro Herrera
Date:
Subject: Re: [HITB-Announce] HITB Magazine Issue 10 Out Now