Re: json datatype and table bloat?

From: Gregory Haase <haaseg(at)onefreevoice(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: json datatype and table bloat?
Date: 2013-10-29 21:55:32
Message-ID: CAHA6QFSvFWXw44X3=W18xF7OY75wyq97gRJtCxuFW5d0BUgZYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom is correct: Vacuum verbose shows that their is an associated toast
table. Neither the check_postgres.pl script or the query on
http://wiki.postgresql.org/wiki/Show_database_bloat appear to take this
into consideration. Both rely on null_frac and avg_width from pg_stats to
estimate how big the table should be. I'm not sure how you would factor the
toast table into that estimate.

-G

On Tue, Oct 29, 2013 at 2:05 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Gregory Haase <haaseg(at)onefreevoice(dot)com> writes:
> > I've isolated the problem to the json field not showing up in pg_stats,
> > which affects the calculation of the avg row size in the bloat query.
>
> > I'm not sure if this is a json issue or some other kind of issue.
>
> Possibly your "bloat query" is failing to consider the toast table
> associated with this table? If the json values are large they'd
> mostly be in the toast table not the main table.
>
> (It's unfortunate that VACUUM FULL doesn't tell you about what's
> in the toast table. I'd try just VACUUM VERBOSE here, without the
> FULL, to get more info.)
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Kane 2013-10-30 10:32:20 Undocumented feature? USING INDEX TABLESPACE
Previous Message Tom Lane 2013-10-29 21:05:39 Re: json datatype and table bloat?