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 1r5naT-00F7NJ-Fc for pgsql-performance@arkaria.postgresql.org; Wed, 22 Nov 2023 13:48:17 +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 1r5naS-008vQn-3L for pgsql-performance@arkaria.postgresql.org; Wed, 22 Nov 2023 13:48:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with utf8esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5naR-008vQB-O8 for pgsql-performance@lists.postgresql.org; Wed, 22 Nov 2023 13:48:15 +0000 Received: from facteur.thefreecat.org ([212.129.38.6]) by makus.postgresql.org with utf8esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r5naP-006oZU-4s for pgsql-performance@lists.postgresql.org; Wed, 22 Nov 2023 13:48:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thefreecat.org; s=thefreecat; t=1700660887; bh=1mshIwlyNvE76splVX98sLXU/UCQlaMYf3ewPni3mFM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=BkGH2B/nE9xOPhhnjPGLQrmP86d3uUqgtaIDPi1iJVX/CFY2+Z8VvcnKmXOxDxyg1 5JAdvey1Yv7tUVB1+SthOxs3IN5UHBNIlnhNnjBYTmKtBoG8w1b5MMKw2cfA63AByP Li9xLSigaF6Zfdmv/ifgt6zjUD5Tca8DOxpM0PAi853qxgOhox8K85BFzUxHh Original-Subject: Re: Performance degradation with CTEs, switching from PG 11 to PG 15 Original-From: Jean-Christophe Boggio Original-Cc: "pgsql-performance@lists.postgresql.org" Received: from [192.168.1.19] (lmontsouris-656-1-93-81.w82-127.abo.wanadoo.fr [::ffff:82.127.255.81]) (AUTH: LOGIN cat, TLS: TLS1.3,128bits,ECDHE_RSA_AES_128_GCM_SHA256) by facteur.thefreecat.org with ESMTPSA id 0000000009DC06D6.00000000655E0697.002C82EE; Wed, 22 Nov 2023 14:48:07 +0100 Message-ID: Date: Wed, 22 Nov 2023 14:48:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Performance degradation with CTEs, switching from PG 11 to PG 15 Content-Language: fr-FR, en-US To: John Naylor Cc: "pgsql-performance@lists.postgresql.org" References: <6245f4b6-e608-4d87-9cd8-d0a7a1b5f9d4@thefreecat.org> From: Jean-Christophe Boggio In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk John, Le 22/11/2023 à 14:30, John Naylor a écrit : > Note that "vacuum full" is not recommended practice in most > situations. Among the downsides, it removes the visibility map, > which is necessary to allow index-only scans. Plain vacuum should > always be used except for certain dire situations. Before proceeding > further, please perform a plain vacuum on the DB. After that, check > if there are still problems with your queries. Did both VACUUM ANALYZE and VACUUM (which one did you recommend exactly?) and things go much faster now, thanks a lot. I will also check why autovacuum did not do its job. >> Is there anything I can do to prevent that kind of behaviour ? I'm >> a little afraid to have to review all the queries in my softwares >> to keep good performances with PG 15 ? Maybe there's a way to >> configure the server so that CTEs are materialized by default ? > > There is no such a way. It would be surely be useful for some users > to have a way to slowly migrate query plans to new planner versions, > but that's not how it works today. Thanks for your input so I know I did not miss a parameter. And yes, that would be handy. Best regards,