Re: Postgres Full Text Search Jsonb Array column does not search for first row

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Dmytro Zhluktenko <d1mnewz(at)gmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres Full Text Search Jsonb Array column does not search for first row
Date: 2019-11-26 19:13:26
Message-ID: 5256d03491ac4a90ae0cf0662712160d63612857.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2019-11-26 at 13:37 +0200, Dmytro Zhluktenko wrote:
> Pgsql is unable to perform indexed full text search onto jsonb column containing an array when looking for the first row in the table.
>
> Any ideas why this is happening?
>
> CREATE OR REPLACE FUNCTION cp.make_tsvector(in_t cp."Repro")
> RETURNS tsvector
> LANGUAGE plpgsql
> IMMUTABLE
>
> [...]
>
> CREATE INDEX repro_fts_idx ON cp."Repro" USING gin (cp.make_tsvector(cp."Repro".*)) WITH (fastupdate=off, gin_pending_list_limit='64');
>
> [...]
>
> -- explain analyze
> SELECT *
> FROM "cp"."Repro" x where cp.make_tsvector(x) @@ 'sup:*'::tsquery

One possibility is that there ar just too few rows in the table.

SET enable_seqscan = off;

and then try again.

If that is not the problm, please provide EXPLAIN (ANALYZE, BUFFERS) output for
the query.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message github kran 2019-11-27 01:22:31 Re: PostGreSQL Replication and question on maintenance
Previous Message Yessica Brinkmann 2019-11-26 18:36:01 Re: I think that my data is saved correctly, but when printing again, other data appears