Kyotaro HORIGUCHI <horiguchi.kyot...@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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to