Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAwiH-0011fI-Ga for pgsql-performance@arkaria.postgresql.org; Tue, 12 Nov 2024 19:38:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tAwiE-008tcN-6C for pgsql-performance@arkaria.postgresql.org; Tue, 12 Nov 2024 19:38:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAwiD-008tbq-S7 for pgsql-performance@lists.postgresql.org; Tue, 12 Nov 2024 19:38:06 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAwiB-001XGA-UG for pgsql-performance@lists.postgresql.org; Tue, 12 Nov 2024 19:38:05 +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 4ACJbajD1224348; Tue, 12 Nov 2024 14:37:37 -0500 From: Tom Lane To: Achilleas Mantzios cc: Tomas Vondra , pgsql-performance@lists.postgresql.org, "P.Groidis" Subject: Re: tds_fdw : Severe performance degradation from postgresql 10.23 to 16.4 In-reply-to: <50da382b-1d47-4332-9279-8af0996f8088@cloud.gatewaynet.com> References: <75b1aafc-bf5f-48fe-a495-fba11d8f0b05@vondra.me> <9640ce5b-3128-4c3c-b901-65747bc67b83@cloud.gatewaynet.com> <6797bc15-486b-48c3-9e89-cf85ae9a4043@vondra.me> <14f7d64f-d864-4429-9cf2-7ef92d6a90fb@vondra.me> <50da382b-1d47-4332-9279-8af0996f8088@cloud.gatewaynet.com> Comments: In-reply-to Achilleas Mantzios message dated "Tue, 12 Nov 2024 20:24:09 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1224346.1731440256.1@sss.pgh.pa.us> Date: Tue, 12 Nov 2024 14:37:36 -0500 Message-ID: <1224347.1731440256@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Achilleas Mantzios writes: > Our sysadm created the system debian Debian GNU/Linux 12 (bookworm)with > postgres as user 1000. Now at some point we realized that whenever we > run a pgsql cluster with another user (I found that after spending two > good days testing), the above query runs in about 1 second. With user > postgres 1000 in 30 seconds. As you saw the perf output are completely > different. Don't recall details offhand, but in some situations where the calling SQL user doesn't have permissions to read particular columns, the planner will not consult statistics for those columns. That can lead to a different, less optimal plan being used. Maybe something like that is happening here? regards, tom lane