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 1v28pO-000h0K-FG for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Sep 2025 13:49:38 +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 1v28pM-001hTU-GC for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Sep 2025 13:49:37 +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 1v28pM-001hTM-6k for pgsql-hackers@lists.postgresql.org; Fri, 26 Sep 2025 13:49:36 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v28pK-000EHb-1c for pgsql-hackers@postgresql.org; Fri, 26 Sep 2025 13:49:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2025010100; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=gZF33pGjuOQUgNntI/bvgiFKMtUamqpw6FgxRqaHp4g=; b=EMXDl vwmFe0v8/rwAis6Ip7KIksKvIWXRqZaHOlAc88Ryfw0c7RRyLqOIky77LAKxb913ITh76/3K870dT 6APYJJzBbb9jDS4OkVT/xrLLnlWRcMtZhmQJrjoLzGLy0kMX8aqU7Qv1fgvzdr548/2tbyex4j1bB z7urIG3grO6sViFWhLvs5cH9wloRlP8byc5+FFkTufV18qMRA2tqgkROH79BCM1MVdRXW/MXOSWyY XNpkdIwGo+dDNwXqJoBh3nq0JEEwS0GtJK1Nc+SVuAfA+z2LDAlzuRFL4kSRj/iJvmf9+fpdGj0kO xahAH+RIsnLEXNgIf1/rTWzZHf4nw==; Received: from bruce by momjian.us with local (Exim 4.98.2) (envelope-from ) id 1v28pH-0000000Auqo-33Kw; Fri, 26 Sep 2025 09:49:31 -0400 Date: Fri, 26 Sep 2025 09:49:31 -0400 From: Bruce Momjian To: Amit Langote Cc: PostgreSQL-development Subject: Re: Batching in executor Message-ID: References: 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 On Fri, Sep 26, 2025 at 10:28:33PM +0900, Amit Langote wrote: > At PGConf.dev this year we had an unconference session [1] on whether > the community can support an additional batch executor. The discussion > there led me to start hacking on $subject. I have also had off-list > discussions on this topic in recent months with Andres and David, who > have offered useful thoughts. > > This patch series is an early attempt to make executor nodes pass > around batches of tuples instead of tuple-at-a-time slots. The main > motivation is to enable expression evaluation in batch form, which can > substantially reduce per-tuple overhead (mainly from function calls) > and open the door to further optimizations such as SIMD usage in > aggregate transition functions. We could even change algorithms of > some plan nodes to operate on batches when, for example, a child node > can return batches. For background, people might want to watch these two videos from POSETTE 2025. The first video explains how data warehouse query needs are different from OLTP needs: Building a PostgreSQL data warehouse https://www.youtube.com/watch?v=tpq4nfEoioE and the second one explains the executor optimizations done in PG 18: Hacking Postgres Executor For Performance https://www.youtube.com/watch?v=D3Ye9UlcR5Y I learned from these two videos that to handle new workloads, I need to think of the query demands differently, and of course can this be accomplished without hampering OLTP workloads? -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.