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 1tArXL-000VKu-E3 for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 14:06:30 +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 1tArXI-006iC9-Pl for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 14:06:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tArXI-006iC1-Eq for pgsql-hackers@lists.postgresql.org; Tue, 12 Nov 2024 14:06:29 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tArXF-001Y0y-GJ for pgsql-hackers@postgresql.org; Tue, 12 Nov 2024 14:06:28 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 01EC21140195; Tue, 12 Nov 2024 09:06:24 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 12 Nov 2024 09:06:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1731420384; x=1731506784; bh=L9vB3wtruZ JLbifRfe/RUw43n9wuGWlcc1ElZSusJjc=; b=H2x4MJilhZSoWGDIXzZGon7vIH /RFflDTuVb3co9jT/UlqZ9ItfL8JqxcBrjW8DpOUiGRM4WlwR55eZT9sOIjhaOOo dbNLVVq37ZeF+7VLafTAWZmZejJc2mDR6MgqylxBz71JGeKLJAtJep0HWqV4FGAe OOOSX/PDNfQ3OAd0bvWTAb942Wn11j3pXeuFYxinJeT4AWPa7v+MgJhbGYEg3upb +I3i1NfdYLuJV+bnWr86ToGQ8UPZllvoLUC2h5bQndFajbcEN/Hw+2fUVC2yhSOi obMhWCpAUOQH0b+bwNqXPZkL8lAUJUzWzZLQPsfhP59B23q1SbqDmY3sVJ3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1731420384; x=1731506784; bh=L9vB3wtruZJLbifRfe/RUw43n9wuGWlcc1E lZSusJjc=; b=luR4orEUoQkBnPtECrxKYPSec9YOx9vbfM0TZ3LLIwOih459p1W j0SkQR3yHMyvF+mJtfQOmRudtMxOJAYTjF5nwiseFmKp6eBjqbosvR36+CdWO6k2 n4bFJjRiRtLl+5voUDyoOrpt76omdQd9U/NU8f/iow4ySFzDVdGlTAa4TJ4YT93M DVftQMMeMgV7dxSUgMX9T82ftd7mB2K8D6F1uszfMJzNB9fDaMNuH1VFDcZb+Cer nl6Ql1hQcp1turME4nWc1ujDnWOmwwazhcn/IWcX5A2oWgyysuNNm+rpApJQlFQi lAhMrnzHMovJpVk4eBYOJ7lFw7OldBVvZYg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtuggjsehttdfstddttddvnecu hfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlh druggvqeenucggtffrrghtthgvrhhnpeeffffgledvffegtdevlefgtdeggffhvdekgfeg teeiveejkeetudelveejhfeugeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghp thhtohepkedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohephhhouhiijhdrfhhnsh htsehfuhhjihhtshhurdgtohhmpdhrtghpthhtohepkhhurhhouggrrdhhrgihrghtohes fhhujhhithhsuhdrtghomhdprhgtphhtthhopegrmhhithdrkhgrphhilhgrudeisehgmh grihhlrdgtohhmpdhrtghpthhtohepshhhvhgvthgrrdhmrghlihhksehgmhgrihhlrdgt ohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrd horhhgpdhrtghpthhtoheprghlvghkshgrnhguvghrsehtihhmvghstggrlhgvrdgtohhm pdhrtghpthhtohepthhomhgrshesvhhonhgurhgrrdhmvgdprhgtphhtthhopehjrghnse ifiheftghkrdhinhhfoh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Nov 2024 09:06:24 -0500 (EST) Date: Tue, 12 Nov 2024 09:06:23 -0500 From: Andres Freund To: "Hayato Kuroda (Fujitsu)" Cc: pgsql-hackers , Amit Kapila , Aleksander Alekseev , shveta malik , "tomas@vondra.me" , Jan Wieck , "Zhijie Hou (Fujitsu)" Subject: Re: Commit Timestamp and LSN Inversion issue Message-ID: <43vrkfqyv72ofuxhltur35twwcxiyujqrcfu3b26yzy4o5eyg3@g4fxomgmnqgk> References: <9f7f4def-7ea8-4ad3-83e7-a8cc9d18c58a@wi3ck.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2024-11-11 09:49:19 +0000, Hayato Kuroda (Fujitsu) wrote: > I've done performance tests compared with master vs. v2 patch. > It showed that for small transactions cases, the performance difference was 0-2%, > which was almost the same of the run-by-run variation. > > We may completely change the approach based on the recent discussion, > but let me share it once. > > ## Executed workload > > Very small transactions with many clients were executed and results between master > and patched were compared. Two workloads were executed and compared: > > - Insert single tuple to the table which does not have indices: > ``` > BEGIN; > INSERT INTO foo VALUES (1); > COMMIT; > ``` > > - Emit a transactional logical replication message: > ``` > BEGIN; > SELECT pg_logical_emit_message(true, 'pgbench', 'benchmarking', false); > COMMIT; > ``` > > ## Results This is not a useful measurement for overhead introduced in ReserveXLogInsertLocation(). What you're measuring here is the number of commits/second, not the WAL insertion rate. The number of commits/second is largely determined by your disk's write latency, the batching of WAL flushes and things like the SLRU code. To measure the effect of changes to ReserveXLogInsertLocation() use something like this as a pgbench script: SELECT pg_logical_emit_message(false, \:client_id::text, '1'), generate_series(1, 10000) OFFSET 10000; Greetings, Andres Freund