Re: proposal - patch: psql - sort_by_size

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Jeremy Finzel <finzelj(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - patch: psql - sort_by_size
Date: 2019-07-31 13:40:04
Message-ID: alpine.DEB.2.21.1907311536510.32534@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Jeremy,

>> Comments, notes?
>
> One oddity about pg_relation_size and pg_table_size is that they can be
> easily blocked by user activity. In fact it happens to us often in
> reporting environments and we have instead written different versions of
> them that avoid the lock contention and still give "close enough" results.
>
> This blocking could result in quite unexpected behavior, that someone uses
> your proposed command and it never returns. Has that been considered as a
> reality at least to be documented?

ISTM that it does not change anything wrt the current behavior because of
the prudent lazy approach: the sorting is *only* performed when the size
is already available in one of the printed column.

Maybe the more general question could be "is there a caveat somewhere that
when doing \d.+ a user may have issues with locks because of the size
computations?".

--
Fabien.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-07-31 13:42:44 Re: Unused header file inclusion
Previous Message Sehrope Sarkuni 2019-07-31 13:25:01 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)