Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o91mh-0000X7-7c for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 09:57:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o91mg-0008Q4-0i for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 09:57:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o91mf-0008Ak-Lj for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 09:57:25 +0000 Received: from mail.epaxios.com ([5.9.99.247]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o91mY-0008Pq-Li for pgsql-general@postgresql.org; Wed, 06 Jul 2022 09:57:24 +0000 Received: from hetzner1.epaxios.com (localhost.localdomain [127.0.0.1]) by mail.epaxios.com (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 2669vE7d014493 for ; Wed, 6 Jul 2022 11:57:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=froehlich.priv.at; s=hetzner1; t=1657101436; bh=dR58XXPQdBVIhkCtnhq5XIVEZEHgRi0qizoGGUFjcEQ=; h=Date:From:To:Subject:References:In-Reply-To:From; b=yOqJyQYkJExJ4uqtRIHvySJifhz8o/vQ7BDpmgRR6xprFq8R96i3Pz5mejY1FioWx MRsjhO+03PeseO32IhOF5SzJ+mC5XkgxW3JUnKXtbDksUSkMP2osNJto3PUtfcUXPl ixcwfyI+I7j8gnD0tU82tJJi50sHMCEfBH6UYiME= Received: (from sfroehli@localhost) by hetzner1.epaxios.com (8.14.4/8.14.4/Submit) id 2669vEYp014492 for pgsql-general@postgresql.org; Wed, 6 Jul 2022 11:57:14 +0200 Date: Wed, 6 Jul 2022 11:57:14 +0200 From: Stefan Froehlich To: pgsql-general@postgresql.org Subject: Re: unable to understand query result Message-ID: <20220706095714.GA13812@static.231.150.9.176.clients.your-server.de> References: <20220706093120.GA11952@static.231.150.9.176.clients.your-server.de> <5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5404d9ee-aeed-15b1-693a-79d47bbd0a73@enterprisedb.com> X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jul 06, 2022 at 11:40:22AM +0200, Peter Eisentraut wrote: > 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'; > >(1 row) > > > >$ select id, pid, length(pid), md5(pid) from product where pid like '%8000000'; > >(2 rows) > >#v- > Check the EXPLAIN output for the two queries. Maybe there is index > corruption somewhere. OMG. Thanks, this was the root of the problem. Never run into this before so it did not come to my mind. Bye, Stefan