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 1ohuB6-0006kZ-G4 for pgsql-general@arkaria.postgresql.org; Mon, 10 Oct 2022 14:54:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ohuA7-000196-8K for pgsql-general@arkaria.postgresql.org; Mon, 10 Oct 2022 14:53:47 +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 1ohuA6-00018x-Tq for pgsql-general@lists.postgresql.org; Mon, 10 Oct 2022 14:53:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohuA4-0005dN-KQ for pgsql-general@lists.postgresql.org; Mon, 10 Oct 2022 14:53:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29AErhoD4073394; Mon, 10 Oct 2022 10:53:43 -0400 From: Tom Lane To: Kostas Papadopoulos cc: Pavel Stehule , Daevor The Devoted , pgsql-general@lists.postgresql.org, Julien Rouhaud Subject: Re: Same query, same data different plan In-reply-to: References: <20b3e283-3107-cd18-6e7f-90ed58e7ddf8@methodosit.com.cy> <8da58bc7-a01a-0168-3d49-062258ac82ec@methodosit.com.cy> <20221010131217.7kzur6b63cl2we7y@jrouhaud> Comments: In-reply-to Kostas Papadopoulos message dated "Mon, 10 Oct 2022 16:23:43 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4073392.1665413623.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 10 Oct 2022 10:53:43 -0400 Message-ID: <4073393.1665413623@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Kostas Papadopoulos writes: > I cannot see how it can be configuration since the two databases are in = the same = > Postgres instance. There is such a thing as ALTER DATABASE ... SET to install different settings at the per-database level. In general, the answer to your question is that the databases are *not* identical. You just haven't figured out how yet. I'm wondering if it has something to do with the dump/reload having compacted out bloat in the tables or indexes, causing cost estimates to change. regards, tom lane