Re: SELECT with LIKE clause makes full table scan

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Dominique Devienne <ddevienne(at)gmail(dot)com>, Matthias Apitz <guru(at)unixarea(dot)de>, Josef Šimánek <josef(dot)simanek(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: SELECT with LIKE clause makes full table scan
Date: 2022-01-26 15:07:28
Message-ID: YfFjsGid9ZbjRxSU@c720-r368166
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


We changed two relevant Indexes to

CREATE INDEX d01ort ON d01buch(d01ort bpchar_pattern_ops );
CREATE INDEX d01ort2 ON d01buch(d01ort2 bpchar_pattern_ops );

and now the same queries are fast. We're looking through our code for
more such LIKE clauses on VCHAR columns.

Thanks for all the hints

matthias
--
Matthias Apitz, ✉ guru(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2022-01-26 15:21:12 Re: SELECT with LIKE clause makes full table scan
Previous Message Tom Lane 2022-01-26 15:03:48 Re: SELECT with LIKE clause makes full table scan