Re: Improve automatic analyze messages for inheritance trees

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve automatic analyze messages for inheritance trees
Date: 2014-11-15 23:35:39
Message-ID: CA+U5nMKk_tRA6nXFOu+oGEXBqEHLPoWDaf_Hmmk7Zg7ipPBTPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 30 October 2014 03:30, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> (2014/10/17 18:35), Etsuro Fujita wrote:
>>
>> (2014/10/16 17:17), Simon Riggs wrote:
>>>
>>> Would it be useful to keep track of how many tables just got analyzed?
>>>
>>> i.e. analyze of foo (including N inheritance children)
>>
>>
>> I think that's a good idea. So, I'll update the patch.
>
>
> Done. Attached is an updated version of the patch.
>
> Thanks for the comment!

The patch was kinda ok, but we have deeper problems.

If we have a 3 level hierarchy like foo->(p1, p2->(p4), p3)
then we still report this pretty strangely
LOG: automatic analyze of table "postgres.public.p1" system usage:
CPU 0.00s/0.00u sec elapsed 0.05 sec
LOG: automatic analyze of table "postgres.public.foo" system usage:
CPU 0.00s/0.00u sec elapsed 0.04 sec
LOG: automatic analyze of table "postgres.public.foo" (including 3
inheritance children) system usage: CPU 0.00s/0.01u sec elapsed 0.12
sec
LOG: automatic analyze of table "postgres.public.p4" system usage:
CPU 0.00s/0.00u sec elapsed 0.00 sec

notice that p4 is not included as an inheritance child, even though it
most surely is. Why is p4 reported, when p1, p2 and p3 are not?

and I notice psql reports this incorrectly also

postgres=# \d+ foo

Table "public.foo"
Column | Type | Modifiers | Storage | Stats target | Description

----------+---------+-----------+---------+--------------+-------------

?column? | integer | | plain | |

Child tables: p1,
p2,
p3

>>No mention of grandchildren...

Not your fault, but this patch doesn't sufficiently improve the
situation to commit it, yet.

Sorry, patch returned with feedback, for now.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2014-11-15 23:57:34 Re: New Event Trigger: table_rewrite
Previous Message David Rowley 2014-11-15 23:19:29 Re: Patch to support SEMI and ANTI join removal