pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthias Apitz <guru@unixarea.de>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Dominique Devienne <ddevienne@gmail.com>
Cc: Matthias Apitz <guru@unixarea.de>
Cc: Josef Šimánek <josef.simanek@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: SELECT with LIKE clause makes full table scan
Date: Wed, 26 Jan 2022 16:07:28 +0100
Message-ID: <YfFjsGid9ZbjRxSU@c720-r368166> (raw)
In-Reply-To: <20220126135139.uik5gbuzyxybxq4x@jrouhaud>
References: <YfEoqiHQikgT82PB@c720-r368166>
	<CAFp7QwrVFvMr9VOEsEQRBLhAcg9vG1AQwrg8S+mTmJ_f4Dp3sQ@mail.gmail.com>
	<YfEy7Y4gpoMbKlkB@pureos>
	<20220126121306.k6ilsxl7vy2ppmjn@jrouhaud>
	<CAFCRh--nsj2afcFP0iFU6_n9Hb4bSBmGu+YktkkZ8GwDXf1rYQ@mail.gmail.com>
	<20220126135139.uik5gbuzyxybxq4x@jrouhaud>


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@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub





view thread (12+ messages)  latest in thread

Message-ID: <YfFjsGid9ZbjRxSU@c720-r368166>
Permalink:  ../YfFjsGid9ZbjRxSU@c720-r368166/
Also on:    postgresql.org/message-id/YfFjsGid9ZbjRxSU@c720-r368166

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: guru@unixarea.de, rjuju123@gmail.com, ddevienne@gmail.com, josef.simanek@gmail.com
  Subject: Re: SELECT with LIKE clause makes full table scan
  In-Reply-To: <YfFjsGid9ZbjRxSU@c720-r368166>
  References: <YfEoqiHQikgT82PB@c720-r368166> <CAFp7QwrVFvMr9VOEsEQRBLhAcg9vG1AQwrg8S+mTmJ_f4Dp3sQ@mail.gmail.com> <YfEy7Y4gpoMbKlkB@pureos> <20220126121306.k6ilsxl7vy2ppmjn@jrouhaud> <CAFCRh--nsj2afcFP0iFU6_n9Hb4bSBmGu+YktkkZ8GwDXf1rYQ@mail.gmail.com> <20220126135139.uik5gbuzyxybxq4x@jrouhaud> <YfFjsGid9ZbjRxSU@c720-r368166>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox