json datatype and table bloat?

From: Adam Jelinek <ajelinek(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, John R Pierce <pierce(at)hogranch(dot)com>, Gregory Haase <haaseg(at)onefreevoice(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: json datatype and table bloat?
Date: 2013-11-04 16:35:10
Message-ID: CAMwTJE6qLvY9Te1nifXXjNVw34JxG1SRFK2e2+jrCB8vTOH3Vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Along the lines of the equality operator; I have ran into issues trying to
pivot a table/result set with a json type due what seemed to be no equality
operator.

On Nov 4, 2013 10:14 AM, "Merlin Moncure"
<mmoncure(at)gmail(dot)com<javascript:_e({}, 'cvml', 'mmoncure(at)gmail(dot)com');>>
wrote:

> On Fri, Nov 1, 2013 at 1:50 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us<javascript:_e({}, 'cvml', 'tgl(at)sss(dot)pgh(dot)pa(dot)us');>>
> wrote:
> > Gregory Haase <haaseg(at)onefreevoice(dot)com <javascript:_e({}, 'cvml',
> 'haaseg(at)onefreevoice(dot)com');>> writes:
> >> The json_data column is not accounted for in pg_stats:
> >
> > Ah! I hadn't twigged to the fact that your bloat measurement approach
> > assumed you had pg_stats entries for all the columns.
> >
> >> So I'm not sure if I'd actually qualify this as a "bug", but it appears
> >> that there is no way to currently get stats on a json data type.
> >
> > ANALYZE currently punts on columns that don't have an equality operator,
> > which json does not. There isn't that much in the way of stats that we
> > could collect, though I suppose we could still compute average datum
> width
> > and null fraction.
> >
> > I'm not sure whether there are plans to invent an equality operator for
> > json.
>
> IMNSO, this may not be a bug, but it's pretty close. All base types
> should have equality operator as well as other supporting
> infrastructure that the database itself depends on (in/out and
> send/receive for example). This is a pretty good example of why.
>
> merlin
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org<javascript:_e({}, 'cvml', 'pgsql-general(at)postgresql(dot)org');>
> )
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Sent from Gmail Mobile

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Amiel 2013-11-04 17:06:28 table lock when where clause uses unique constraing instead of primary key.
Previous Message Merlin Moncure 2013-11-04 16:12:39 Re: json datatype and table bloat?