Re: Indexing on JSONB field not working

From: Zhihong Zhang <zhihong(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Indexing on JSONB field not working
Date: 2020-01-02 22:07:28
Message-ID: FF2FADEB-3496-4CDF-AC15-E57D706A53B8@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On Jan 2, 2020, at 4:58 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Zhihong Zhang <zhihong(at)gmail(dot)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 logic that 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2020-01-02 22:17:36 Re: BUG #16183: PREPARED STATEMENT slowed down by jit
Previous Message Tom Lane 2020-01-02 21:58:14 Re: Indexing on JSONB field not working