| From: | Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> |
|---|---|
| To: | Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: scan on inheritance parent with no children in current session |
| Date: | 2017-08-07 02:56:32 |
| Message-ID: | 592621c7-3712-77de-eb6c-53075199dcf5@lab.ntt.co.jp |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 2017/08/04 18:11, Ashutosh Bapat wrote:
> After that commit in session 1, we get an Append plan
> postgres=# explain verbose select * from parent;
> QUERY PLAN
> -------------------------------------------------------------------
> Append (cost=0.00..0.00 rows=1 width=4)
> -> Seq Scan on public.parent (cost=0.00..0.00 rows=1 width=4)
> Output: parent.a
> (3 rows)
>
> I don't think this is an intentional change. Here's patch to fix it.
> The comment in the patch uses term "real child" in the context of
> comments about temporary children from other session and the comment
> at the end of the function where rte->inh is reset. May be we should
> move the second comment before setting has_child in the patch and use
> "real child" in the comment at the end to avoid repetition. But I want
> to first check whether we want this fix or we can live with the Append
> plan.
Good catch. I agree that getting an Append node after that commit is
unintentional and we should fix so that we don't get an Append. So, +1 to
your patch. I looked at the patch and the code fix seems to do what we want.
Thanks,
Amit
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Thomas Munro | 2017-08-07 03:25:11 | Re: Effect of dropping a partitioned table's column over time |
| Previous Message | Amit Langote | 2017-08-07 02:35:30 | Re: Effect of dropping a partitioned table's column over time |