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 1v6wCb-00CESC-Fn for pgsql-general@arkaria.postgresql.org; Thu, 09 Oct 2025 19:21:25 +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 1v6wCZ-008BCP-91 for pgsql-general@arkaria.postgresql.org; Thu, 09 Oct 2025 19:21:24 +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 1v6wCY-008BCB-TG for pgsql-general@lists.postgresql.org; Thu, 09 Oct 2025 19:21:23 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6wCX-000ubg-0d for pgsql-general@lists.postgresql.org; Thu, 09 Oct 2025 19:21:22 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-b48d8deaef9so236860466b.2 for ; Thu, 09 Oct 2025 12:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1760037681; x=1760642481; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Q7LTxYh7TJ2DreLHc59Ef0uEMgguhRTfvEmSRZVUhkg=; b=d5a+wzGU5MQqFKIZinrQpKIvWyq1bU35mmiG1B8vRiw4cc61XUpo7SUGXY5nbrcNGY 1dy6tXHje5wkzOmZdnNQzOAIX4qQmLrs9qsWy5cb3VpLoqIN2SYUQHY4BCICzn5oGcf6 s7lQNWFBuVhPuYZAI8ybx98iIzM9ouNgVqsjv6taTrmowDmI4s2bYfWyT/SL0gMst2nW a5cMoRaviRHFhiwiCZp6UWqZsFGB0VPRX9VxBTvwWSOCkUqbjThKPdG6P6LIxRDOQTlD WXbk9chcIencT0/ACg+4BitTsyLAPOtHN3BW6ZaFFDLdUC+eaJvZTgUalMpA7si1icpv zacA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760037681; x=1760642481; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Q7LTxYh7TJ2DreLHc59Ef0uEMgguhRTfvEmSRZVUhkg=; b=gnOlnYwIxx27vKUcODKmsZZefe/s7RpsfaYEh4TbONbRs0GoiONaICHizwwQFodK/u y3KHheGzQgO7PkgZPuX+2T/6i69/ooXPNABSgc1wVoV6FYCBFYa/9IrgcjH9TGerrVaJ dS+LQhZUBYV+PgAPzr3N6hTBJn3DDHKLOZM/4+Fbxp/SF93WVDUzj3kdEmxEA7mHZ+mI 0YzTacCgkI0ws0JuHrxvEZTcO6i1BFBDvOOGOvnU2ajqAQGs6Tr++4JjFHaR7/eAR7ve uupV9AtG3tbarVtNih4P1ceEvB2HWh0ysopw4isWWpyQ/BmxNQlqk1BquScIljUS9lb0 HPrw== X-Forwarded-Encrypted: i=1; AJvYcCX/30Pi/Mgss5yDYt7M2vk8p54cykgPqplymsDnsIZ2IkGDT2EzQzlq5JYUK9RXDIdiADIUx5iKpolt0RZI@lists.postgresql.org X-Gm-Message-State: AOJu0YwsEfwUkt7NyLrBnBkE6D5Vo8gpmyce6Ic93bW9DVpBdTsChk2V H60SwgxEIzHy0FU219O+13616SoSoITO9ZVshw/dIpczAsZYFlWwFVkCnkGPzhd4A6v+AKj5ZvJ 56dSR3RD1Qg== X-Gm-Gg: ASbGnctrhB4NLjVlr0BDeqYqmVMUKjplICu1ZjKvEwEoZOs7AOW2jpetT5fp8BHNSI9 g6GgVxcjgtCosB68+2l14XwttUx/STETu7KSUdVH2VM73ZktYIHTUcyWTqF76kf7g4ppsW0owNp /9KaonKxnCveVo5/tozPNnoDa+lsPF2F+S9nT3HrJhWvt9Df73TPEu+ROTwhqpaw8YZmSjU7wI4 7WUVFlB5+tMnvftG9lZAIBQIqnxvrihwjQz1tb1xUrPQOTjTf0uJoTYcOWvEY0FJ/QAcJbCTLiY dhpL683tm1InetM9r63bL0Pbemq132YJySGbAQv3N1ZytdCVhczJDBpH18Gw5U9/O1edqjkG0pZ JQ22o5z1/lLbKwNcGL3/mxU1Z9s0Cb/4gVJM2oeQJEK4eRyANvhEKoKSRuxqA7epbw2998hZwL6 H+bqoXsjvmr1KStA== X-Google-Smtp-Source: AGHT+IEby6g3G/wXq25dJO0mHFb5GVjeW8ADXZtG9fz3Ov4V4yHSAvyF8pQUSda3+Nb31IQTZgZisA== X-Received: by 2002:a17:907:1c0f:b0:b40:9dbe:5b68 with SMTP id a640c23a62f3a-b50aa792c29mr824322166b.5.1760037680655; Thu, 09 Oct 2025 12:21:20 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:270:b3a7:5d5a:5d5c:3780:cfe0]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b55d8c129c4sm39601066b.41.2025.10.09.12.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Oct 2025 12:21:20 -0700 (PDT) Message-ID: <938cf470050825d031f624b57f6ca46949304691.camel@cybertec.at> Subject: Re: High latency and profiling From: Laurenz Albe To: Roberto Nunnari , pgsql-general@lists.postgresql.org Date: Thu, 09 Oct 2025 21:21:19 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2025-10-09 at 19:25 +0200, Roberto Nunnari wrote: > I was notified about high latency on one of our PostgreSQL clusters. > This latency is observed from the application and has been increasing.= =20 > There is no indication about the exact database as the application uses= =20 > several DBs, but the largest and most used is 'mydb'. > > Developers report that their software is already optimized and database= =20 > size is not a problem. They suggest the issue might be inside PostgreSQL= =20 > itself. That may be true, but it need not be true. The developers' statement sounds a bit overconfident. > Could somebody help me understand what is causing the growing latency? For that, you have to identify the statements that run longer than they should. Then examine them with EXPLAIN (ANALYZE, BUFFERS), figure out what makes them slow and improve them. Yours, Laurenz Albe