Re: Indexing on JSONB field not working

From: Zhihong Zhang <zhihong(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: 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: 2019-12-26 16:58:27
Message-ID: 83E6A3F7-B1B4-4AD6-905A-BE11D244D35A@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The index name is correct and I ran ‘analyze' multiple times since the index is created. I have dozen indexes, some are created when table is created. None of them is in pg_stats.

The pg_stats only contains a row for each column, nothing else.

The database is on AWS RDS. Does that make any difference?

Zhihong

> On Dec 26, 2019, at 11:50 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>
>> On Dec 21, 2019, at 10:17 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com <mailto:jeff(dot)janes(at)gmail(dot)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.
>>
>
>
> On Thu, Dec 26, 2019 at 11:30 AM Zhihong Zhang <zhihong(at)gmail(dot)com <mailto:zhihong(at)gmail(dot)com>> wrote:
> That command yields nothing.
>
> Did you use the actual name of the index (in case its actual name differs from what you showed us in the CREATE INDEX)? If you did and it doesn't show anything, then I don't think the table has been ANALYZED since the index was created. Note that ANALYZE and EXPLAIN ANALYZE are different things. You need to run "ANALYZE assets;" or "VACUUM ANALYZE assets;"
>
> Cheers,
>
> Jeff

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kuldip Zalavadiya 2019-12-26 17:29:19 PostgreSQL Installation Error
Previous Message Jeff Janes 2019-12-26 16:50:24 Re: Indexing on JSONB field not working