pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Zhihong Zhang <zhihong@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: Indexing on JSONB field not working
Date: Sun, 29 Dec 2019 00:56:04 +0100
Message-ID: <20191228235604.g75ymd7dvc5nwxgt@development> (raw)
In-Reply-To: <CE20A918-FDF4-4D43-A969-6CBB70B69164@gmail.com>
References: <20191220223005.f6w4ff4kdbgtanpz@development>
	<E3D6070E-72E0-4FE5-9E30-D114530F383F@gmail.com>
	<20191221114003.yo56lv3o6thdvxtn@development>
	<21855.1576943356@sss.pgh.pa.us>
	<0AA828F3-5BA5-48CD-B229-8351ACB308D3@gmail.com>
	<167501d5bcdb$13854b20$3a8fe160$@gmail.com>
	<11610.1577468732@sss.pgh.pa.us>
	<202A204F-FE4D-414A-ABD0-B7773A0C7316@gmail.com>
	<CAMkU=1y+D8SyZ+MOQAsJN_4HRm5QaLWFgKe2MyXbkbz0d5fmrA@mail.gmail.com>
	<CE20A918-FDF4-4D43-A969-6CBB70B69164@gmail.com>

On Sat, Dec 28, 2019 at 02:59:07PM -0500, Zhihong Zhang wrote:
>>
>> Only one of your indexes is over an expression.  The index over a
>> plain column will never have stats, as column stats are stored with
>> the table, not the index.
>>
>
>Oh. That explains it. I tweaked a few server parameters, wonder if that
>made the difference. I changed,
>
>pg_stat_statements.track:	ALL	
>
>track_activity_query_size: 2048
>
>Now we have stats, can anyone see why the index is not used?
>

I don't follow. Neither of these configuration options should affect
which indexes have stats. The expression index should have stats no
matter how these two GUCs are set.

But once again, you're making claims without actually showing us the
data. How do you know we have stats now? Show us pg_stats data and
the explain plans.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 





view thread (43+ messages)  latest in thread

Message-ID: <20191228235604.g75ymd7dvc5nwxgt@development>
Permalink:  ../20191228235604.g75ymd7dvc5nwxgt@development/
Also on:    postgresql.org/message-id/20191228235604.g75ymd7dvc5nwxgt@development

 · 

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: tomas.vondra@2ndquadrant.com, zhihong@gmail.com, jeff.janes@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Indexing on JSONB field not working
  In-Reply-To: <20191228235604.g75ymd7dvc5nwxgt@development>
  References: <20191220223005.f6w4ff4kdbgtanpz@development> <E3D6070E-72E0-4FE5-9E30-D114530F383F@gmail.com> <20191221114003.yo56lv3o6thdvxtn@development> <21855.1576943356@sss.pgh.pa.us> <0AA828F3-5BA5-48CD-B229-8351ACB308D3@gmail.com> <167501d5bcdb$13854b20$3a8fe160$@gmail.com> <11610.1577468732@sss.pgh.pa.us> <202A204F-FE4D-414A-ABD0-B7773A0C7316@gmail.com> <CAMkU=1y+D8SyZ+MOQAsJN_4HRm5QaLWFgKe2MyXbkbz0d5fmrA@mail.gmail.com> <CE20A918-FDF4-4D43-A969-6CBB70B69164@gmail.com> <20191228235604.g75ymd7dvc5nwxgt@development>

* 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