From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> |
Cc: | mathias(at)brossard(dot)org, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: ToDo: show size of partitioned table |
Date: | 2018-10-31 06:30:45 |
Message-ID: | CAFj8pRBujL1LfOps0_3JyowkRObtMEekzVU+KzwLj3F_jyEV5g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
st 31. 10. 2018 v 3:27 odesílatel Amit Langote <
Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> napsal:
> On 2018/10/30 20:03, Pavel Stehule wrote:
> > út 30. 10. 2018 v 7:52 odesílatel Amit Langote <
> > Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> napsal:
> >> Could one of you please revise the patch to use that function to produce
> >> the output of \dP+?
> >>
> >
> > here it is.
> >
> > It is based on Mathias's patch. Although we can use pg_partition_tree on
> > PostgreSQL, we still should to support PostgreSQL 10, 11 where this
> > function is not available
>
> Thanks for updating the patch. Just a couple of comments:
>
> + is used, a sum of size of related partitions and a description
>
> I suggest:
>
> is used, the sum of sizes of related partitions and associated description
>
> + appendPQExpBufferStr(&buf, "\nWHERE c.relkind IN ('p')\n");
>
> I wonder if we should list partitioned indexes ('I') as well, because
> their size information is not available with \di+. But maybe, they should
> have a separate command.
>
I though about it too and I prefer separate command. Similar to \di+
> + if (PQntuples(res) == 0 && !pset.quiet)
> + {
> + if (pattern)
> + psql_error("Did not find any relation named \"%s\".\n",
> + pattern);
> + else
> + psql_error("Did not find any relations.\n");
> + }
>
> I think we should use "partitioned table" instead of "relation" in the
> above error messages, because this command is specifically finding
> partitioned tables.
>
> (If we decide to include partitioned indexes as well, then the above error
> message should say "partitioned relation")
>
> + fprintf(output, _(" \\dP[+] [PATTERN] list partitioned
> tables\n"));
>
> Again, if we include indexes, this should be "partitioned relations".
>
> How about adding a couple of regression tests?
>
I am not sure. Has not sense run this test over empty database, and some
bigger database can increase running.
More the size can be platform depend.
Regards
Pavel
>
> Thanks,
> Amit
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Langote | 2018-10-31 06:34:02 | Re: ToDo: show size of partitioned table |
Previous Message | Kevin Van | 2018-10-31 05:02:06 | WIP Patch: Add a function that returns binary JSONB as a bytea |