Re: [patch] Proposal for \rotate in psql

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Greg Stark <stark(at)mit(dot)edu>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [patch] Proposal for \rotate in psql
Date: 2015-12-18 11:06:27
Message-ID: CAFj8pRC-HwTEJ=fjf9bcN03agfsST+wN+Zdvqp74dxm9JcUvqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-12-17 21:33 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

>
>
> 2015-12-14 23:09 GMT+01:00 Daniel Verite <daniel(at)manitou-mail(dot)org>:
>
>> Pavel Stehule wrote:
>>
>> > postgres=# \crosstabview 4 +month label
>> >
>> > Maybe using optional int order column instead label is better - then
>> you can
>> > do sort on client side
>> >
>> > so the syntax can be "\crosstabview VCol [+/-]HCol [[+-]HOrderCol]
>>
>> In the meantime I've followed a different idea: allowing the
>> vertical header to be sorted too, still server-side.
>>
>> That's because to me, the first impulse for a user noticing that
>> it's not sorted vertically would be to write
>> \crosstabview +customer month
>> rather than figure out the
>> \crosstabview customer +month_number month_name
>> invocation.
>> But both ways aren't even mutually exclusive. We could support
>> \crosstabview [+|-]colV[:labelV] [+|-]colH[:labelH]
>> it's more complicated to understand, but not harder to implement.
>>
>> Also, a non-zero FETCH_COUNT is supported by this version of the patch,
>> if the first internal FETCH retrieves less than FETCH_COUNT rows.
>> Otherwise a specific error is emitted.
>>
>> Also there are minor changes in arguments and callers following
>> recent code changes for \o
>>
>> Trying to crosstab with 10k+ distinct values vertically, I've noticed
>> that the current code is too slow, spending too much time
>> sorting. I'm currently replacing its simple arrays of distinct values
>> with AVL binary trees, which I expect to be much more efficient for
>> this.
>>
>
> I played with last version and it is looking well. I have only one notice,
> but it is subjective - so can be ignored if you don't like it.
>
> The symbol 'X' in two column mode should be centred - now it is aligned to
> left, what is not nice. For unicode line style I prefer some unicode symbol
> - your chr(10003) is nice.
>
>
I checked code and I have only one note. The name "sortColumns" is not
valid now, and it isn't well - maybe ServerSideSort or some similar can be
better. The error message "Unexpected value when sorting horizontal
headers" is obsolete too.

Regards

Pavel

> Regards
>
> Pavel
>
>
>
>>
>> Best regards,
>> --
>> Daniel Vérité
>> PostgreSQL-powered mailer: http://www.manitou-mail.org
>> Twitter: @DanielVerite
>>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-12-18 11:25:56 Re: Patch: fix lock contention for HASHHDR.mutex
Previous Message Aleksander Alekseev 2015-12-18 10:57:21 Re: Patch: fix lock contention for HASHHDR.mutex