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 1kx0l1-0006Kk-07 for pgsql-general@arkaria.postgresql.org; Wed, 06 Jan 2021 04:49:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kx0kz-0007IR-Vl for pgsql-general@arkaria.postgresql.org; Wed, 06 Jan 2021 04:49:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kx0kz-0007Fk-LM for pgsql-general@lists.postgresql.org; Wed, 06 Jan 2021 04:49:13 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kx0kx-0003s2-A1 for pgsql-general@lists.postgresql.org; Wed, 06 Jan 2021 04:49:12 +0000 Received: by mail-wr1-x435.google.com with SMTP id a12so1246237wrv.8 for ; Tue, 05 Jan 2021 20:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=Se23H1Kg57+1ZmgvBacZWFeA5R9ZB//D0uWozLvYnrY=; b=er1pQbqLbJgiyrlis25NnkxfgS3TQP68+PGit5y2lCsgNKg6TGY1ERdgENPX+jVcY/ /R/f+SqiEBBjX6NZUF75RdCVNzljsldHnuAcPQyMqV5vaK+306q09jwTnP6jffh2sTp4 cEZ1LTeSV4jGg3zttHRYDbPguy9+m2VdDHTgGo86DNFv9ta3+qLOlZzLZd3vGNSbBl48 og/rSfoYpoOQMX/mFO24gr1/Q36EziiDNOVpwGp+P/gt/GcxdQVjqQDR98MxJFzC7395 fMdMocEGe9SfQWtLoNWM7FF7Ps/nHNNvHeOKxf/IJ6edYw2BTlHjb0Y2+0LEdaNz0Tn1 GReA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Se23H1Kg57+1ZmgvBacZWFeA5R9ZB//D0uWozLvYnrY=; b=j4EKYgRzmr11VLy6xj0pt2vnt3mLRN6DGJyFdThtQKRzuTX/6/Jpuoiyl6k7LstQyo rKPujNpY0YM0YhTWGVvRKZ8Y03ScOCFsBwgfwy2Ihr6kWwaQwDslhO8MuZFAGkLk55TW ev052xhBOxWJkn6C18uCZRDsmRfqzb9/ei7hmLGuoyyn/WYmLlBDlAzp+hxMhk5iJoWZ K+07rwTNMic3V+Y3bMoT57vpLccGqmBuAsS/K3zJr7wPH7RycO1iXERYIrpEL9VvYJId kWAnCsFHPFsnduoXcb5S7tA1Z4b5YJ4ttInArC+GXB7+p3p66v4RtgvH2UHh20Tj5z7h YS8A== X-Gm-Message-State: AOAM530q0pThDMHLsezkGpe+oJIeDQFnMFkUJ7tKoXeeH1wV017AeHs5 FmA27+z1ySV/JibNVOu1gXaf0Q== X-Google-Smtp-Source: ABdhPJyNp/En7DG3UI+X9Nxz++OSX/Yrm+LFHDS1GRQCvumCIp+vfgntILB2H20mqykEGMh9k7rXUA== X-Received: by 2002:a05:6000:124e:: with SMTP id j14mr2495647wrx.310.1609908549209; Tue, 05 Jan 2021 20:49:09 -0800 (PST) Received: from localhost.localdomain (178-190-176-169.adsl.highway.telekom.at. [178.190.176.169]) by smtp.gmail.com with ESMTPSA id v7sm1468007wma.26.2021.01.05.20.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 20:49:08 -0800 (PST) Message-ID: <7e49c83b1179e052b415eb0f8f78f5f2c0dec734.camel@cybertec.at> Subject: Re: SQL to query running transactions with subtransactions that exceeds 64 From: Laurenz Albe To: Li EF Zhang , pgsql-general@lists.postgresql.org Date: Wed, 06 Jan 2021 05:49:08 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2021-01-05 at 10:42 +0000, Li EF Zhang wrote: > I am new to postgresql and sql. I want to check running transactions whose > subtransactions exceeds 64. Is there any SQL statement or other method can > do this? Thanks! You may want to read https://www.cybertec-postgresql.com/en/subtransactions-and-performance-in-postgresql/ You could export a snapshot with pg_export_snapshot() and see if the resulting file contains the line "sof:1". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com