"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