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 1oi8Pl-0001wS-K8 for pgsql-general@arkaria.postgresql.org; Tue, 11 Oct 2022 06:06:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oi8Pi-0001Qx-Lk for pgsql-general@arkaria.postgresql.org; Tue, 11 Oct 2022 06:06:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oi8Pi-0001Qo-BJ for pgsql-general@lists.postgresql.org; Tue, 11 Oct 2022 06:06:50 +0000 Received: from bar-esg3.cablenet.com.cy ([109.110.244.75] helo=barracuda.cablenet.com.cy) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oi8Pf-0005wa-Lw for pgsql-general@lists.postgresql.org; Tue, 11 Oct 2022 06:06:49 +0000 X-ASG-Debug-ID: 1665468404-17c037132c918a0001-cI9M9q Received: from mail0.cablenet.com.cy (mail.cablenet.com.cy [213.140.208.238]) by barracuda.cablenet.com.cy with ESMTP id CqY15pziWrRBPrLU (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 11 Oct 2022 09:06:44 +0300 (EEST) X-Barracuda-Envelope-From: kostas@methodosit.com.cy X-Barracuda-Effective-Source-IP: mail.cablenet.com.cy[213.140.208.238] X-Barracuda-Apparent-Source-IP: 213.140.208.238 Received: from localhost (localhost [127.0.0.1]) by mail0.cablenet.com.cy (Postfix) with ESMTP id B5A685BBAF5; Tue, 11 Oct 2022 09:06:44 +0300 (EEST) Received: from mail0.cablenet.com.cy ([127.0.0.1]) by localhost (mail0.cablenet.com.cy [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id XAg_ou26PlTn; Tue, 11 Oct 2022 09:06:44 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mail0.cablenet.com.cy (Postfix) with ESMTP id 7CBE15BB9C9; Tue, 11 Oct 2022 09:06:44 +0300 (EEST) X-Virus-Scanned: amavisd-new at mail0.cablenet.com.cy Received: from mail0.cablenet.com.cy ([127.0.0.1]) by localhost (mail0.cablenet.com.cy [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bjdjeGFezyLK; Tue, 11 Oct 2022 09:06:44 +0300 (EEST) Received: from [192.168.98.4] (66.red-88-21-136.staticip.rima-tde.net [88.21.136.66]) by mail0.cablenet.com.cy (Postfix) with ESMTPSA id 0E1355B90D6; Tue, 11 Oct 2022 09:06:43 +0300 (EEST) Message-ID: <14b38f31-452c-22d6-6a4f-bd79e2e026b5@methodosit.com.cy> Date: Tue, 11 Oct 2022 09:06:43 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: Same query, same data different plan Content-Language: en-US X-ASG-Orig-Subj: Re: Same query, same data different plan To: Adrian Klaver Cc: pgsql-general@lists.postgresql.org References: <20b3e283-3107-cd18-6e7f-90ed58e7ddf8@methodosit.com.cy> <8da58bc7-a01a-0168-3d49-062258ac82ec@methodosit.com.cy> <20221010131217.7kzur6b63cl2we7y@jrouhaud> <4073393.1665413623@sss.pgh.pa.us> <37fcbc79-c9c9-979d-f7ad-43771e7923c5@methodosit.com.cy> From: Kostas Papadopoulos In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail.cablenet.com.cy[213.140.208.238] X-Barracuda-Start-Time: 1665468404 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://172.30.36.6:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cablenet.com.cy X-Barracuda-Scan-Msg-Size: 550 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.101339 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Adrian, On 10/10/2022 20:59, Adrian Klaver wrote: > Information needed: > > 1) The query and its EXPLAIN ANALYZE for both slow/fast cases. > > 2) Postgres version. > > 3) What database are the developers workstation pointing at? > > 4) What is the test db and is it the same as 3)? > > 5) What clients are you using to run the query? > Thanks for the interest. I was just looking for pointers on what to look at next. Got that from Tom (table bloat) and Imre (different random sample of analyze). Regards kostas