Index not always being used

From: John Scalia <jayknowsunix(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Index not always being used
Date: 2019-08-29 14:15:28
Message-ID: 180F96D3-690E-466E-B73E-F6B34C6409C7@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I’ve got a table with approximately 5.5 million rows, and one column that is frequently searched is of type varchar(50) and we just put a trigram index on it. Now, if we search “where bld_city = ‘baskingridge’”, explain says a sequential table scan is going to be used, but if I change the query to use “where bold_city like ‘basking%’”, then explain correctly shows that a bitmap index scan will be performed. Why would these two forms use different approaches? I’m a bit confused.

Jay

Sent from my iPad

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Holger Jakobs 2019-08-29 14:22:36 Re: Index not always being used
Previous Message Licio Matos 2019-08-28 20:59:11 Re: Backup From HotStandby