Re: Indexing on JSONB field not working - Mailing list pgsql-bugs

From Tomas Vondra
Subject Re: Indexing on JSONB field not working
Date
Msg-id 20191228235604.g75ymd7dvc5nwxgt@development
Whole thread Raw
In response to Re: Indexing on JSONB field not working  (Zhihong Zhang <zhihong@gmail.com>)
Responses Re: Indexing on JSONB field not working  (Zhihong Zhang <zhihong@gmail.com>)
List pgsql-bugs
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 



pgsql-bugs by date:

Previous
From: Zhihong Zhang
Date:
Subject: Re: Indexing on JSONB field not working
Next
From: Zhihong Zhang
Date:
Subject: Re: Indexing on JSONB field not working