Re: postrgesql query planner wrong desicion

From: Kenny Bachman <kenny(dot)bachman17(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: postrgesql query planner wrong desicion
Date: 2022-06-18 06:41:38
Message-ID: CAC0w7L+huSuV8EbMe5pbS+1b-Akxpbu_RsszLRigiFFq1OLhXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Tom,

The gist index is used by other queries with LIKE or ILIKE operators.
Should I drop the gist index for text or varchar columns?

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 17 Haz 2022 Cum, 17:19 tarihinde şunu yazdı:

> Kenny Bachman <kenny(dot)bachman17(at)gmail(dot)com> writes:
> > With GIST Index: (Total exec time : 34s)
>
> > Index Scan using "Pool_Party_Code_gist" on "Pool_Party" (cost=0.28..8.30
> > rows=1 width=4) (actual time=0.097..0.097 rows=1 loops=330870)
> > Index Cond: (("Code")::text =
> > 'TEAM-FIXPOWERUSER'::text)
>
> > Without GIST Index: (Total exec time: 4s)
>
> > Index Scan using "Pool_Party_Code_idx" on "Pool_Party" (cost=0.42..8.44
> > rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=330870)
> > Index Cond: (("Code")::text =
> > 'TEAM-FIXPOWERUSER'::text)
>
> Why do you have a gist index on a column that's apparently plain
> text (or varchar)? It seems kinda pointless, and the more so if
> it duplicates a btree index.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Janes 2022-06-18 15:36:45 Re: postrgesql query planner wrong desicion
Previous Message Vijaykumar Jain 2022-06-18 02:01:16 Re: Logical replication on two identical databases but diff versions