Re: proposal - patch: psql - sort_by_size - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: proposal - patch: psql - sort_by_size
Date
Msg-id alpine.DEB.2.21.1907311536510.32534@lancre
Whole thread Raw
In response to Re: proposal - patch: psql - sort_by_size  (Jeremy Finzel <finzelj@gmail.com>)
List 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.



pgsql-hackers by date:

Previous
From: Sehrope Sarkuni
Date:
Subject: Re: [Proposal] Table-level Transparent Data Encryption (TDE) and KeyManagement Service (KMS)
Next
From: Tom Lane
Date:
Subject: Re: Unused header file inclusion