Re: UNION ALL on partitioned tables won't use indices. - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Re: UNION ALL on partitioned tables won't use indices.
Date
Msg-id 20140305.152841.228310775.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: UNION ALL on partitioned tables won't use indices.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: UNION ALL on partitioned tables won't use indices.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello, I haven't look closer on their relationship.

> > Hello, I examined the your patch and it seemed reasonable, but I
> > have one question about this patch.
> 
> > You made ec_relids differ to the union of all ec members'
> > em_relids. Is it right?
> 
> ec_relids has never included child relids.

relation.h says that,

|    Relids  ec_relids;   /* all relids appearing in ec_members */    
...
|    Relids  em_relids;   /* all relids appearing in em_expr */   

But add_eq_member already did this, so the point was whether it's
ok to omit intermediate relations...

|   else if (!is_child)  /* child members don't add to ec_relids */
|   {
|       ec->ec_relids = bms_add_members(ec->ec_relids, relids);
|   }
|   ec->ec_members = lappend(ec->ec_members, em);

I understood that it is ok because an inheritance tree must have
one parent and it can be the representative for whole its
descendents so it's no problem. Thank you, I'll go on.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: API change advice: Passing plan invalidation info from the rewriter into the planner?
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Trigger information for auto_explain.