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 1tKmtt-00AmLm-D7 for pgsql-performance@arkaria.postgresql.org; Mon, 09 Dec 2024 23:10:49 +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 1tKmtq-00Ce6j-JU for pgsql-performance@arkaria.postgresql.org; Mon, 09 Dec 2024 23:10:47 +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 1tKmtq-00Ce6a-6p for pgsql-performance@lists.postgresql.org; Mon, 09 Dec 2024 23:10:47 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tKmto-001ynq-Nb for pgsql-performance@lists.postgresql.org; Mon, 09 Dec 2024 23:10:46 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-38634c35129so1974204f8f.3 for ; Mon, 09 Dec 2024 15:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postgres.ai; s=google; t=1733785843; x=1734390643; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6EW9MRoAFwUz/UDwX2e6KPXo08ZNBYJPjQHyRZIT0RY=; b=Dq0+wKD7yDJO9t3Q2wSYUc3k+iTjRoPkJG0XsmK/V+a3187IjmpS/+pIl2MMXTGmBN wyAbO/T1Xa0NgAYXIe8b5Wc3zKem57s47fB+zeGe6Sa+bhbhA/fbE4YTVz9KW4O+k/ie XW+01Nkqk8Ob56VPwl654LfqzipN13o2wwYJJScUy6PNeIfIQ9eME9f4tunFOgx8R2hY 5V4jVKf7y5P6Vii3zkUZR4YWE7v3Kgl5bvjTs3RWswQ2p5vaNDHhzCuCQ/P+XlY6ogaW ox91NVlUt6Y0VpRNTPI26NiYNpsWVY/Cy6fDvhJMzOPkOWRDq2ifF6S/bZtIasqQqBMH jjqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733785843; x=1734390643; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6EW9MRoAFwUz/UDwX2e6KPXo08ZNBYJPjQHyRZIT0RY=; b=CzPyY9QwbG8Fp9uDgn0hlD6GE6bo5da4dcca9nPKNO1w7PNLKr854ZK35XtoWNMxPI nQFo6X0sZPudzTVa5oKfzXzptgYN5E+yyfqzP4zPo31+u/tYPHKISuEWnqbS2iMUwggy 9p66lGphrbORpQU8JmerJSwilzIyRkOKNV25sZ0m/N+q8KuknmEa5HqE73vn95Fv0G8y WpF0uQC8p/V0hZlpiC2uWoa5ac8p3ZZcNTTLJJ+7PMTr/iaLFgugcMuyOf+rprRYHJKy 3/2wMVLzeh6a8KMKYYyE5EnsaEdIt6aBWIbQuyWjRsAmJNtDnXXEEW0vZcDmvHOfAT7B 8X5w== X-Gm-Message-State: AOJu0Ywelz7wuqZh5U2T44sm4cumvbKuwNAHFpPdLHpMZXSVaZYI5yO4 sJVqEKrNgWnEC92DHQhGUe0KvS/731YSUwPD+5c9hdMqwiwjo9+f0XWlWAdyv/DZOcSXFsQP0Hg fQNX6T01BDLmRit5/1cX+YRLSoL3UJHZAChNoci0aLQpaTytOvLRG5A== X-Gm-Gg: ASbGncvRhB/Tw3aaejhpq/0lXeWmtLk37FjsAzrlvTreMlaS9shLpjmDAq/PzDn8Sw/ p4DTQZnnGLkbyG71Lm+LHMMQbNiaZAejNTt/x X-Google-Smtp-Source: AGHT+IEfhZNvLkJUUF+NqeQ1x3qyUHwqu7hWvUWJ+D+nNzXWW6w+Vvv/n6MmNwr4y18s6wvlAZr8lpdm060Y0iPGNss= X-Received: by 2002:a05:6000:4112:b0:382:47d0:64be with SMTP id ffacd0b85a97d-386453dff87mr1470661f8f.29.1733785843048; Mon, 09 Dec 2024 15:10:43 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nikolay Samokhvalov Date: Mon, 9 Dec 2024 15:10:32 -0800 Message-ID: Subject: Re: can a blocked transaction affect the performance of one that is blocking it? To: Eric Schwarzenbach Cc: "pgsql-performance@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000004aba2f0628de7985" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004aba2f0628de7985 Content-Type: text/plain; charset="UTF-8" On Mon, Dec 9, 2024 at 13:16 Eric Schwarzenbach wrote: > Hi, > > Could one transaction (one that should be relatively simple and short) > cause another complex, long running transaction (involving INSERTS, on a > table the first transaction may be reading from) to take many orders of > magnitude longer than it would normally? (short of competing for system > resources, like CPU time etc, of course) > > I don't believe my scenario involved a deadlock but I expect my short > transaction was probably blocked by my long one. Does it make any sense > that this could very significantly affect the performance of the > non-blocked transaction? > > Thanks, > > Eric Have you tried wait event analysis (looking at wait_event_type, wait_event, state, query samples from pg_stat_activity)? > --0000000000004aba2f0628de7985 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Dec 9, 2024 at 13:16 Eric Schwarzenbach <subscriber@blackbrook.org> wrote:
Hi,

Could one transaction (one that should be relatively simple and short)
cause another complex, long running transaction (involving INSERTS, on a table the first transaction may be reading from) to take many orders of magnitude longer than it would normally? (short of competing for system resources, like CPU time etc, of course)

I don't believe my scenario involved a deadlock but I expect my short <= br> transaction was probably blocked by my long one. Does it make any sense that this could very significantly affect the performance of the
non-blocked transaction?

Thanks,

Eric

Have you tri= ed wait event analysis (looking at wait_event_type, wait_event, state, quer= y samples from pg_stat_activity)?
--0000000000004aba2f0628de7985--