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 1r7fkr-006EwC-9a for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2023 17:50:45 +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 1r7fkp-00FH3J-1v for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2023 17:50:43 +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 1r7fko-00FH39-OD for pgsql-hackers@lists.postgresql.org; Mon, 27 Nov 2023 17:50:42 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7fkm-008pWu-AC for pgsql-hackers@postgresql.org; Mon, 27 Nov 2023 17:50:42 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id C9A313200C08; Mon, 27 Nov 2023 12:50:35 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 27 Nov 2023 12:50:36 -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:sender :subject:subject:to:to; s=fm1; t=1701107435; x=1701193835; bh=q/ a4gH/iT4F0HeSQ7H+kmesKpPIfOkOs3A6eBkb0s/Y=; b=vnwAfFu2ktL6vb1bbT avCx7q0c2scQ23qDc1MeTRBlRGr7jMaYwwlFHlpocUfjraBI0scAAOeba4dOoovM f/07PmiWE17oyS+FpDhkNo/bX/KN66MAe/DUAGC7zsP501CKPHKtxfcQI7n0tisU ioTREce1eJEHvRwswEkBTvQY9B90pGNl25Qy9TlipIL2RTRXk7rgKdYklFbgvsZp vhYXOSw29zgkPLCPVAhxuStO922ZFEPtGB6hRznjRLbe3Geik7lpqfSa4oRzQpgT uLNXWfgxBbLvoi29HbnqckeUx0dkUjCScNdc2mqD0SWU1knhW3+k+fHsgGYOZth2 yYyg== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701107435; x=1701193835; bh=q/a4gH/iT4F0H eSQ7H+kmesKpPIfOkOs3A6eBkb0s/Y=; b=H+8SfiDv1sR4OVNTz7W4SqmfFlZU0 XeyAq4buMiapd1BmMn+VnrmI0UWynp1OJvnLKQ4UOib3RPOyZADcIaKyyUrTctDG U4rUEndJuflybMrUVV35ZgxSLQgqSnODdU5IO0FAHFOlFlBlKI+Gb2xGhF1ZdCTh l2LSFIhEx9GDeCkvSiGgtxwUqEeWiczUX72hhbtGBposc6Z4dpfuZRkNeiSj4T9k sevJ63fhTaseBEifXiVquNg1pwoi5huqE2aQiSBdHw5n4PxTtxosI+oA2m2H8yIW 17NEch+RTp1RNB2WJSP8Aw/9bKzfrNNj2k7sVFtkqwTBbD4f5lY8pYe1g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeiuddguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteev udeitedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Nov 2023 12:50:34 -0500 (EST) Date: Mon, 27 Nov 2023 09:50:32 -0800 From: Andres Freund To: Alvaro Herrera Cc: Andrew Dunstan , Amit Langote , jian he , Erik Rijkers , PostgreSQL-development Subject: Re: remaining sql/json patches Message-ID: <20231127175032.wzb7kpt3ynix6hwr@awork3.anarazel.de> References: <202311271406.budphctjy3p3@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202311271406.budphctjy3p3@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-11-27 15:06:12 +0100, Alvaro Herrera wrote: > On 2023-Nov-27, Andrew Dunstan wrote: > > > Interesting. But inferring a speed effect from such changes is difficult. I > > don't have a good idea about measuring parser speed, but a tool to do that > > would be useful. Amit has made a start on such measurements, but it's only a > > start. I'd prefer to have evidence rather than speculation. Yea, the parser table sizes are influenced by the increase in complexity of the grammar, but it's not a trivial correlation. Bison attempts to compress the state space and it looks like there are some heuristics involved. > At this point one thing that IMO we cannot afford to do, is stop feature > progress work on the name of parser speed. Agreed - I don't think anyone advocated that though. > But at some point we'll probably have to fix that by parsing differently (a > top-down parser, perhaps? Split the parser in smaller pieces that each deal > with subsets of the whole thing?) Yea. Both perhaps. Being able to have sub-grammars would be quite powerful I think, and we might be able to do it without loosing cross-checking from bison that our grammar is conflict free. Even if the resulting combined state space is larger, better locality should more than make up for that. > The amount of effort spent on the parsing aspect on this thread seems in > line with what we should always be doing: keep an eye on it, but not > disregard the work just because the parser tables have grown. I think we've, in other threads, not paid enough attention to it and just added stuff to the grammar in the first way that didn't produce shift/reduce conflicts... Of course a decent part of the problem here is the SQL standard that so seems to like adding one-off forms of grammar (yes, func_expr_common_subexpr, I'm looking at you)... Greetings, Andres Freund