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

From Zhihong Zhang
Subject Re: Indexing on JSONB field not working
Date
Msg-id FF2FADEB-3496-4CDF-AC15-E57D706A53B8@gmail.com
Whole thread Raw
In response to Re: Indexing on JSONB field not working  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Indexing on JSONB field not working
List pgsql-bugs

> On Jan 2, 2020, at 4:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Zhihong Zhang <zhihong@gmail.com> writes:
>> So I like to report 2 bugs,
>
>> 1. “CREATE INDEX” with expression should generate stats automatically.
>
> It does.
I created an index with JSONB field yesterday. It still didnn’t have stats today till I ran ‘analyze’.

>
>> 2. Auto-analyze should generate stats if it is not available, regardless of the number of records changed.
>
> This doesn't square with anyone else's reality either.

We have auto-analyze running every night and it didn’t create the stats either. I think it’s probably related to the
logicthat it skips analyzing if not enough records changed. There was no database changes at all in our case. 

I can reproduce those problems easily. Just tell me what information you need to help debugging and I will get it for
you.Thanks! 

Zhihong




pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Indexing on JSONB field not working
Next
From: Andres Freund
Date:
Subject: Re: BUG #16183: PREPARED STATEMENT slowed down by jit