| From: | Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> | 
|---|---|
| To: | Stefan Froehlich <postgresql(at)froehlich(dot)priv(dot)at>, pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: unable to understand query result | 
| Date: | 2022-07-06 09:40:22 | 
| Message-ID: | 5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Karsten Hilbert | 2022-07-06 09:45:14 | Re: lifetime of the old CTID | 
| Previous Message | Peter Eisentraut | 2022-07-06 09:38:22 | Re: ADD COLUMN ts tsvector GENERATED too slow |