pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Stefan Froehlich <postgresql@froehlich.priv.at>
To: pgsql-general@postgresql.org
Subject: Re: unable to understand query result
Date: Wed, 6 Jul 2022 11:40:22 +0200
Message-ID: <5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com> (raw)
In-Reply-To: <20220706093120.GA11952@static.231.150.9.176.clients.your-server.de>
References: <20220706093120.GA11952@static.231.150.9.176.clients.your-server.de>

On 06.07.22 11:31, Stefan Froehlich wrote:
> I have a database returing these result sets for two almost
> identical queries:
> 
> #v+
> $ select id, pid, length(pid), md5(pid) from product where pid  like '8000000';
>   id   | pid     | length |               md5
> ------+---------+--------+----------------------------------
>   3594 | 8000000 |      7 | 60b5792913f4acbccf45c281fa9e3c9f
> (1 row)
> 
> $ select id, pid, length(pid), md5(pid) from product where pid  like '%8000000';
>   id   | pid     | length |               md5
> ------+---------+--------+----------------------------------
>   3594 | 8000000 |      7 | 60b5792913f4acbccf45c281fa9e3c9f
>    722 | 8000000 |      7 | 60b5792913f4acbccf45c281fa9e3c9f
> (2 rows)
> #v-

Check the EXPLAIN output for the two queries.  Maybe there is index 
corruption somewhere.





view thread (3+ messages)  latest in thread

Message-ID: <5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com>
Permalink:  ../5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com/
Also on:    postgresql.org/message-id/5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com

 · 

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: peter.eisentraut@enterprisedb.com, postgresql@froehlich.priv.at
  Subject: Re: unable to understand query result
  In-Reply-To: <5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com>
  References: <20220706093120.GA11952@static.231.150.9.176.clients.your-server.de> <5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com>

* 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