pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zhihong Zhang <zhihong@gmail.com>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: Indexing on JSONB field not working
Date: Thu, 26 Dec 2019 11:30:47 -0500
Message-ID: <E0F0CF2B-46DB-425C-9338-0FA59561B6B6@gmail.com> (raw)
In-Reply-To: <CAMkU=1z8X1s0WChsgKU7SN8ngrLKHt38UhAqKn-nGTf+xbQ9zg@mail.gmail.com>
References: <0cf001d5b77f$bfe47e10$3fad7a30$@gmail.com>
	<20191220223005.f6w4ff4kdbgtanpz@development>
	<E3D6070E-72E0-4FE5-9E30-D114530F383F@gmail.com>
	<CAMkU=1z8X1s0WChsgKU7SN8ngrLKHt38UhAqKn-nGTf+xbQ9zg@mail.gmail.com>

That command yields nothing. If I use the tablename ‘assets’, it only returns stats on columns, nothing about indexes. The indexed field is in JSONB field ‘_doc’. This is the stats on the column,

select * from pg_stats where tablename='assets' and attname='_doc';
 schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_
common_elem_freqs | elem_count_histogram
------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------
------------------+----------------------
 public     | assets    | _doc    | f         |         0 |        18 |         -1 |                  |                   |                  |             |                   |
                  |
(1 row)

Let me know if you want any other information.

Zhihong


> On Dec 21, 2019, at 10:17 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> 
> Can you show the output of:
> 
> select * from pg_stats where tablename ='float_number_index_path2'
> 
> For readability, use the output format which shows the columns down the screen, not across.  In psql, that would toggled on with \x.
> 

view thread (43+ messages)  latest in thread

Message-ID: <E0F0CF2B-46DB-425C-9338-0FA59561B6B6@gmail.com>
Permalink:  ../E0F0CF2B-46DB-425C-9338-0FA59561B6B6@gmail.com/
Also on:    postgresql.org/message-id/E0F0CF2B-46DB-425C-9338-0FA59561B6B6@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: zhihong@gmail.com, jeff.janes@gmail.com, tomas.vondra@2ndquadrant.com
  Subject: Re: Indexing on JSONB field not working
  In-Reply-To: <E0F0CF2B-46DB-425C-9338-0FA59561B6B6@gmail.com>
  References: <0cf001d5b77f$bfe47e10$3fad7a30$@gmail.com> <20191220223005.f6w4ff4kdbgtanpz@development> <E3D6070E-72E0-4FE5-9E30-D114530F383F@gmail.com> <CAMkU=1z8X1s0WChsgKU7SN8ngrLKHt38UhAqKn-nGTf+xbQ9zg@mail.gmail.com> <E0F0CF2B-46DB-425C-9338-0FA59561B6B6@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox