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 1syq4Q-002WwN-Ni for pgsql-admin@arkaria.postgresql.org; Thu, 10 Oct 2024 10:06:59 +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 1syq4P-00FI88-CX for pgsql-admin@arkaria.postgresql.org; Thu, 10 Oct 2024 10:06:57 +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 1syq4P-00FI79-14 for pgsql-admin@lists.postgresql.org; Thu, 10 Oct 2024 10:06:57 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1syq4M-000BaC-Mf for pgsql-admin@lists.postgresql.org; Thu, 10 Oct 2024 10:06:56 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-430558cddbeso4630835e9.1 for ; Thu, 10 Oct 2024 03:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728554813; x=1729159613; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=7My2kypnxo0127HAIeinMniyx3EBNk58/+7/FToQ+qs=; b=A5ZuCj4GIWJkhCalVzclnNErqO2JBMKKoNewocTtXCEHq/pgotBF1iEau3VZvFZYDi AiSYoI1Bhim0u/7TV107KxI6q+6XGcER0F+k5lRz5bZEPJquQLLILAymOaVk24YY8VVf menfdCvOVJnlQs2IYgun6E0sMB6EEovmHjLTuk5WePXbtEnwPMlVY/Ov3aPUXzuFJmls UFxOd5d4IN4CMVwPHhHTCe3+vQ1+HfzoDJXXJtiVGjueZwPRENrHlBA9VrE88S+JTUWB gu5pAAEL8izhCBRyZUR+jyYPUX7A2xPsU3qBnbLszKfGkmIj7CLHsWuca/cmRW7vsPTF SPmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728554813; x=1729159613; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7My2kypnxo0127HAIeinMniyx3EBNk58/+7/FToQ+qs=; b=KikR1W9D8hMANZK9GNkVEWza57+3pmeogmPjblNIrx5r16fFiCux16lLl2jI7BByYf EnwBgIU2rC4m6eymtSp5jYvdzqP5GjLCWkall5P3x0X2IamBS/X0QtuSEXzaJ/Eks5L0 UmXtmdKwH1BDWK5GE8toROjmlAb/LCejgw02NlPH+Jp8kh6sXm9iY9sFgkcQFhH6Onro ANAOOWsKIRSM4VIPbyRTnchlSYy1ahUMSetRDvRzJ4WNeM8qwC3r91xYe/MLubsM4AEC SXPW1xBxpO+lb2FjO3cxnvZ1WuOHU/10iLiehdN5ODUr+dlR+/QplfCRyb67py9lSkuF BaJg== X-Gm-Message-State: AOJu0Yy00kwPMhWFvBDWe+Vpze4r5r2E5TrC112Bo+y5/GDA1dHVjtu7 GG5UzQ1Ox3RZutn2kzS+MoS0i1H4wO3aydvlrVWqgLo86hQRuAcjp2Yt2XlMsoeS3ncGBscgYPJ jKTlBk5vcRdbIzmDUF9alN4SUArKYDiDJ X-Google-Smtp-Source: AGHT+IEVrpWf4VLlB6eLAGdbJDSPSCZ9xsTCyVwhvrQ19NhTUayU0FfsIyFNGaa6zxWjySw3dqYnzr3YNLG0vQpxqKI= X-Received: by 2002:a05:600c:3106:b0:42c:b68f:38fb with SMTP id 5b1f17b1804b1-43115aadd84mr23195225e9.7.1728554812399; Thu, 10 Oct 2024 03:06:52 -0700 (PDT) MIME-Version: 1.0 From: SOzcn Date: Thu, 10 Oct 2024 13:06:40 +0300 Message-ID: Subject: Google Cloud PostgreSQL Upgrade v11 to 15 To: Pgsql-admin Content-Type: multipart/alternative; boundary="000000000000916a1a06241c872d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000916a1a06241c872d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello All, I hope everything is well with you. I have some issues after upgrading the GCP. We performed an upgrade on Google Cloud PostgreSQL from version 11 to 15. Initially, we executed this in our test environment, and there were no major issues observed. However, we unfortunately encountered a performance issue with one particular query after the upgrade of Production. Below is my detailed analysis, and I would appreciate your comments on the matter. When we carried out the upgrade in the Production environment, we faced several major problems. First and foremost, there was a relentless disk issue and high CPU consumption. We realized that the root cause of these two problems was the activation of the log_duration parameter, which was generating thousands of logs per second, and we resolved it. We also discovered that the execution plans had changed after the upgrade, which was expected. Since it was performing a table scan, retrieving a total of 200 records through paging took minutes. By setting the random_page_cost parameter to 4, I managed to direct it towards an Index Scan. As a result, the 200 records were fetched within 3-5 seconds. At this point, the query is running consistently on both version 11 and version 15, taking 3-5 seconds to retrieve 200 records. However, while version 11 processed 20,000 records in 15-20 seconds, version 15 is taking 1.5-2 minutes for the same amount. The query contains many joins and subqueries. Based on this, I maximized the values of the work_mem parameter and ran tests, but no improvement was observed. In my research on similar cases, I found that some cases reported success by disabling the jit parameter, but it didn=E2=80=99t help in my case. I also tried standard analyze and index maintenance, including rebuilding the indexes. Additionally, I took the problematic database to my local environment and conducted tests on versions 15 and 16. However, there was no change in performance. After analyzing the query, I tried certain indexing methods on the identified costly parts, but they didn=E2=80=99t help. Additionally, I test= ed by disabling the subqueries and using temporary tables, but that also did not lead to a solution. I look forward to your comments on this matter. --000000000000916a1a06241c872d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello All,
I hope everything is well with you. I h= ave some issues after upgrading the GCP.

We performed an upgrade on = Google Cloud PostgreSQL from version 11 to 15. Initially, we executed this = in our test environment, and there were no major issues observed.

Ho= wever, we unfortunately encountered a performance issue with one particular= query after the upgrade of Production. Below is my detailed analysis, and = I would appreciate your comments on the matter.

When we carried out = the upgrade in the Production environment, we faced several major problems.= First and foremost, there was a relentless disk issue and high CPU consump= tion. We realized that the root cause of these two problems was the activat= ion of the log_duration parameter, which was generating thousands of logs p= er second, and we resolved it.

We also discovered that the execution= plans had changed after the upgrade, which was expected. Since it was perf= orming a table scan, retrieving a total of 200 records through paging took = minutes. By setting the random_page_cost parameter to 4, I managed to direc= t it towards an Index Scan. As a result, the 200 records were fetched withi= n 3-5 seconds.

At this point, the query is running consistently on b= oth version 11 and version 15, taking 3-5 seconds to retrieve 200 records. = However, while version 11 processed 20,000 records in 15-20 seconds, versio= n 15 is taking 1.5-2 minutes for the same amount.

The query contains= many joins and subqueries. Based on this, I maximized the values of the wo= rk_mem parameter and ran tests, but no improvement was observed.

In = my research on similar cases, I found that some cases reported success by d= isabling the jit parameter, but it didn=E2=80=99t help in my case.

I= also tried standard analyze and index maintenance, including rebuilding th= e indexes. Additionally, I took the problematic database to my local enviro= nment and conducted tests on versions 15 and 16. However, there was no chan= ge in performance.

After analyzing the query, I tried certain indexi= ng methods on the identified costly parts, but they didn=E2=80=99t help. Ad= ditionally, I tested by disabling the subqueries and using temporary tables= , but that also did not lead to a solution.

I look forward to your c= omments on this matter.
--000000000000916a1a06241c872d--