Re: unexpected result for wastedbytes query after vacuum full - Mailing list pgsql-performance

From Guillaume Lelarge
Subject Re: unexpected result for wastedbytes query after vacuum full
Date
Msg-id CAECtzeX06VQq_rfYx+JiWpvUsoPvw03TqzThG8VYWdnwyn6FZQ@mail.gmail.com
Whole thread Raw
In response to Re: unexpected result for wastedbytes query after vacuum full  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-performance
Le mar. 10 déc. 2019 à 20:48, Jeff Janes <jeff.janes@gmail.com> a écrit :
On Tue, Dec 10, 2019 at 11:43 AM Guillaume Lelarge <guillaume@lelarge.info> wrote:

This query uses the column statistics to estimate bloat. AFAIK, json columns don't have statistics, so the estimation can't be relied on (for this specific table at least).

This was true prior to 9.5 (for xml at least, I don't know about json), but should not be true from that release onward.  But still the difference between 74440704 and 74506240, this does seem to me to be straining at a gnat to swallow a camel.


I just checked, and you're right. There are less statistics with json, but the important ones (null_frac and avg_width) are available for json and jsonb datatypes. So the query should work even for tables using these datatypes.

Thanks for the information, that's very interesting. And I apologize for the noise.


--
Guillaume.

pgsql-performance by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Specific query taking time to process
Next
From: Fahiz Mohamed
Date:
Subject: Re: Specific query taking time to process