Re: proposal - patch: psql - sort_by_size

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera from 2ndQuadrant <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - patch: psql - sort_by_size
Date: 2019-09-13 08:06:46
Message-ID: CAFj8pRAb1pNPorOqz8NdNSaTx5aO6Frx4T0ZqugT8aABdKUvGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 13. 9. 2019 v 9:35 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
napsal:

>
>
> čt 12. 9. 2019 v 0:01 odesílatel Alvaro Herrera from 2ndQuadrant <
> alvherre(at)alvh(dot)no-ip(dot)org> napsal:
>
>> On 2019-Jul-31, Rafia Sabih wrote:
>>
>> > I had a look at this patch, seems like a useful thing to have.
>>
>> So the two initial questions for this patch are
>>
>> 1. Is this a feature we want?
>> 2. Is the user interface correct?
>>
>> I think the feature is useful, and Rafia also stated as much. Therefore
>> ISTM we're okay on that front.
>>
>> As for the UI, Fabien thinks the patch adopts one that's far too
>> simplistic, and I agree. Fabien has proposed a number of different UIs,
>> but doesn't seem convinced of any of them. One of them was to have
>> "options" in the command,
>> \dt+ [-o 1d,2a]
>>
>
>> Another idea is to use variables in a more general form. So instead of
>> Pavel's proposal of SORT_BY_SIZE=on we could do something like
>> SORT_BY=[list]
>> where the list after the equal sign consists of predetermined elements
>> (say SIZE, NAME, SCHEMA and so on) and indicates a specific column to
>> sort by. This is less succint than Fabien's idea, and in particular you
>> can't specify it in the command itself but have to set the variable
>> beforehand instead.
>>
>
> for more generic design probably you need redesign psql report systems.
> You cannot to use just ORDER BY 1,2 on some columns, but you need to
> produce (and later hide) some content (for size).
>
> So it can be unfunny complex patch. I finished sort inside pspg and I it
> looks to be better solution, than increase complexity (and less
> maintainability (due support old releases)).
>

I changed status for this patch to withdrawn

I like a idea with enhancing \dt about some clauses like " \dt+ [-o
1d,2a]". But it needs probably significant redesign of describe.c module.
Maybe implementation of some simple query generator for queries to system
catalogue can good.

Surely - this should be implemented from scratch - I am not a volunteer for
that.

Pavel

> Regards
>
> Pavel
>
>
>> --
>> Álvaro Herrera https://www.2ndQuadrant.com/
>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2019-09-13 08:17:23 Re: pgbench - allow to create partitioned tables
Previous Message Fabien COELHO 2019-09-13 08:05:13 Re: pgbench - allow to create partitioned tables