From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Andrus <kobruleht2@hot.ee>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Query returns no rows in pg_basebackup cluster
Date: Thu, 21 May 2020 19:36:01 -0400
Message-ID: <19749.1590104161@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZ7UzCgCGNTSGoO4OXtgy_ZhLPN5uA_bwEX8T2Txm_iwA@mail.gmail.com>
References: <2B1267647FD14565B73801AF12CA1A88@dell2>
<ea1e505d-d049-1d1d-e3b3-e655928949b8@aklaver.com>
<17696.1590101245@sss.pgh.pa.us>
<7736da96-5b03-d334-1be5-e593fc54d40b@aklaver.com>
<CAKFQuwZ7UzCgCGNTSGoO4OXtgy_ZhLPN5uA_bwEX8T2Txm_iwA@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Thu, May 21, 2020 at 3:57 PM Adrian Klaver <adrian.klaver@aklaver.com>
> wrote:
>> Well what I was trying to figure out was:
>> "Windows server this query returns 0 rows.
>> In Windows server same query using like
>> select * from firma1.desktop where baas like '_LOGIFAI'
>> returns properly 16 rows. "
> The LIKE query probably doesn't use an index and thus finds the relevant
> data via sequential scan and equality checks on each record.
Yeah, exactly. An equality condition will use a btree index if
available. LIKE, however, sees the "_" as a wildcard so it cannot
use an index and resorts to a seqscan --- which will work fine.
It's just index searches (and index-based sorts) that are broken.
Of course, if there isn't an index on the column in question
then this theory falls to the ground.
regards, tom lane
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: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, adrian.klaver@aklaver.com, kobruleht2@hot.ee
Subject: Re: Query returns no rows in pg_basebackup cluster
In-Reply-To: <19749.1590104161@sss.pgh.pa.us>
References: <2B1267647FD14565B73801AF12CA1A88@dell2> <ea1e505d-d049-1d1d-e3b3-e655928949b8@aklaver.com> <17696.1590101245@sss.pgh.pa.us> <7736da96-5b03-d334-1be5-e593fc54d40b@aklaver.com> <CAKFQuwZ7UzCgCGNTSGoO4OXtgy_ZhLPN5uA_bwEX8T2Txm_iwA@mail.gmail.com> <19749.1590104161@sss.pgh.pa.us>
* 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