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 1ricL4-000c26-MP for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Mar 2024 15:40:51 +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 1ricL3-00DYUb-B4 for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Mar 2024 15:40:49 +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 1ricL3-00DYUT-16 for pgsql-hackers@lists.postgresql.org; Fri, 08 Mar 2024 15:40:49 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ricKu-003V20-Ib for pgsql-hackers@lists.postgresql.org; Fri, 08 Mar 2024 15:40:47 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33e6f9ce76aso694864f8f.3 for ; Fri, 08 Mar 2024 07:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1709912440; x=1710517240; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dQqeB09/Vel0LzCChtA9EDFSLkDMyBQSs2TkOqxk2Xc=; b=JmsQloRkn8aXjnl0a3Od7EB+bpffIguhr2KYgxhNg+oGYREqJUXM7kcSxyThcFK9MI j+H5WWarLqq4hsPg5GnCHsFTqB3849mjzvrJhLTDyVjPncAVHLpNDGRfW5SYFnnykY7X fjPVzDb1YkQm3H2U1uGqFzmyHGf4xEkLQWyrPbB9OeBiXOSL3Eb7U/BNcL4OwT6//3Gx jJ/saMjbYrLZznTDlo130BSX6srN8p75Pht237LLwcKv/Omn1JkT6Xn2a7+Zir+Ywh9C Jd8YY3NLhU3W0E8RpLjv4iguV8ZdGEhAUyMOnQcVOWJgu/30hyrN/8ZtzyQ6sfEbw7yy ZOCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709912440; x=1710517240; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dQqeB09/Vel0LzCChtA9EDFSLkDMyBQSs2TkOqxk2Xc=; b=LCuR8IK8vKu+Rh7C+yERJMyZPLqmGrMm0yNhaGSF6lEqiLuk62P/2lQZhXC/LCwl+N Ckmqlm7d/tfPuX256ANCBxleDTTW49K16uTqyEaw4KH5ekqlP9G+jVSvelkwoAEFuTQl zkxn8qXFT/d2NMAdQho4Lw70XhkQp3Kt3VWBZWBBpPlYPNT/RkBhr9J0L9bI1opjN66M aND44MLd5fVnT1nwnOocCqulXjJLDe7VAEYNST3IstM4S3qm0/8K+0nNzSIwm/wfCX3j 3EIuhdlIyj1+j3s6Mc9JMLkoVg+h2f/nIpu12rOyuuwrsbeKsrucaR6nNUK99qMT3VPR ldLQ== X-Forwarded-Encrypted: i=1; AJvYcCW2k/FsdCFdFB69ROwmyOxwQ3a11+7zDWvYSvVnXleMiXe+HxCEyU2JCXda3dUyeIw5D0SjJ9i4+NsbRKe6/RejgcLwHx3jG64i/wm3MGO2r9Mg X-Gm-Message-State: AOJu0YyxcAi/MyIhMB1FnDoiB+8h+CDnPciqhUPOIklvOwEq8clx1ABa JiKt77Mz+tRH0a+Y4BQ0EjMvvNTKi9mhdZmC5LISKqzsp7e1UgbL9N7DmYCqHQ== X-Google-Smtp-Source: AGHT+IG++vwFMe7xVyb1qoDSpXdE/SMGUSlZk6O9aMkNQb9835CiaSzvOKFrSmEHGBjguRp707LWRg== X-Received: by 2002:a5d:5089:0:b0:33e:707a:2411 with SMTP id a9-20020a5d5089000000b0033e707a2411mr3139024wrt.44.1709912440072; Fri, 08 Mar 2024 07:40:40 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id ay1-20020a5d6f01000000b0033e22a7b3f8sm20053789wrb.75.2024.03.08.07.40.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Mar 2024 07:40:39 -0800 (PST) Message-ID: Date: Fri, 8 Mar 2024 16:40:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Identify transactions causing highest wal generation Content-Language: en-US To: Gayatri Singh , pgsql-hackers@lists.postgresql.org References: From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/8/24 15:50, Gayatri Singh wrote: > Hello Team, > > Can you help me with steps to identify transactions which caused wal > generation to surge ? > You should probably take a look at pg_waldump, which prints information about WAL contents, including which XID generated each record. I don't know what exactly is your goal, but sometimes it's not entirely direct relationship. For example, a transaction may delete a record, which generates just a little bit of WAL. But then after a checkpoint a VACUUM comes around, vacuums the page to reclaim the space of the entry, and ends up writing FPI (which is much larger). You could argue this WAL is also attributable to the original transaction, but that's not what pg_waldump will allow you to do. FPIs in general may inflate the numbers unpredictably, and it's not something the original transaction can affect very much. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company