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 1rRneh-009QdR-I1 for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 06:19:36 +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 1rRneg-001VBt-ED for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 06:19:34 +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 1rRneg-001VBl-4r for pgsql-hackers@lists.postgresql.org; Mon, 22 Jan 2024 06:19:34 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rRned-002k7s-QY for pgsql-hackers@postgresql.org; Mon, 22 Jan 2024 06:19:32 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2cd0d05838fso31854191fa.1 for ; Sun, 21 Jan 2024 22:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705904369; x=1706509169; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cfKXQp9Rv5gcHgrZcx0V5fvS8E+OoPZENsYHluag/eU=; b=Y+PwczT8UtNIcHB2CLe1qx2HT8e5BaR+iwmO+N0u3FeMgIE5fwWru7JH3D6NH75D98 VaYuFQr5W0EoRiR/si4DKgLg+CiSryM+G1wLdOkkPxPo7cVoVglGaUOAkgT08HlFfFzH 1DwapZDEGROb1pa6Tr/DkPv0Hjx5kk/KFoLNLQhm1ioQO/oxV0lSNhIEhQeHddiapdtF LGj6E9lVz6rwvezkBhfe6ziM3jaiX73xUOqpn6GIjI33/enmbv8NrRNHI+u+UzVDt/e7 WGKBx7fkSqH235j+UeDhXpLnDmeejEffqSCST7xK5FEXUwcn/S6G9aZ2Tnv3l5hMwRxT LAuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705904369; x=1706509169; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cfKXQp9Rv5gcHgrZcx0V5fvS8E+OoPZENsYHluag/eU=; b=J2FObSGsxRoLKqeIo2l8fs06DiON68D6OlR3FzIcWYR1FxskJwqgS/688AhUarwb/J TaL6hmDkcM+T4qCNk7PDEn7/nHzFsgiVNUFHHIRdTJZaXOgWwqtqgaCAD+far9ubICKc om6NBnZ4PCQzKV8a2bg2ei+Z/9oFaIKqUCYvVHfJq0OOZZfYbMzw6+W+8lBzKFHxBHdM PsOe/1Qhx6Cb1cDr2bSNBZI54mEjOfEdvih013Xch8gaf5tOVU4yXTva69NLk4qPhMCW gK/s9erhkHv1i5j6xoddLSvzIpFhj9DOlmcMJlfqqhhg3mYZRrPtwW/2dRqhTre4L4V6 emkQ== X-Gm-Message-State: AOJu0YzuBA2YG/LCCIMm3E4UVYA+wtqjqKb4FQknzJB4Xx49bP1PLzBj opvu1jRFeCC/H8lo4GSmOG4gkpKo7NStv9AcajVJkT33RVQcaWMzRzc9M5g/+3isHbrpWvM24Ci gnYI4i2oFcPYwz/izcw7nLfDYmjg= X-Google-Smtp-Source: AGHT+IHxap8OR9e2O7NQbrQ6GqIBbFC7ZPiy5Mmqvixn/VuN1UkEDxgIjgXJy4wWa16QYx6PGQq6yN87Sga5ZtHp+Ms= X-Received: by 2002:a2e:bd02:0:b0:2ce:e3d:b0c8 with SMTP id n2-20020a2ebd02000000b002ce0e3db0c8mr979367ljq.80.1705904368810; Sun, 21 Jan 2024 22:19:28 -0800 (PST) MIME-Version: 1.0 References: <202311271406.budphctjy3p3@alvherre.pgsql> In-Reply-To: <202311271406.budphctjy3p3@alvherre.pgsql> From: John Naylor Date: Mon, 22 Jan 2024 13:19:17 +0700 Message-ID: Subject: Re: remaining sql/json patches To: Alvaro Herrera Cc: Andrew Dunstan , Amit Langote , Andres Freund , jian he , Erik Rijkers , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Nov 27, 2023 at 9:06=E2=80=AFPM Alvaro Herrera wrote: > At this point one thing that IMO we cannot afford to do, is stop feature > progress work on the name of parser speed. I mean, parser speed is > important, and we need to be mindful that what we add is reasonable. > 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?) I was reorganizing some old backups and rediscovered an experiment I did four years ago when I had some extra time on my hands, to use a lexer generator that emits a state machine driven by code, rather than a table. It made parsing 12% faster on the above info-schema test, but only (maybe) 3% on parsing pgbench-like queries. My quick hack ended up a bit uglier and more verbose than Flex, but that could be improved, and in fact small components could be shared across the whole code base. I might work on it again; I might not.