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.96) (envelope-from ) id 1waAEE-001Zjo-0Z for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 10:44:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1waAED-00Apvk-0I for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 10:44:09 +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.96) (envelope-from ) id 1waAEC-00Apvb-2e for pgsql-hackers@lists.postgresql.org; Thu, 18 Jun 2026 10:44:08 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1waAEB-00000000xNq-12ac for pgsql-hackers@postgresql.org; Thu, 18 Jun 2026 10:44:07 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-c074142cf6dso127469166b.0 for ; Thu, 18 Jun 2026 03:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781779445; cv=none; d=google.com; s=arc-20240605; b=YL7MqIvpHj03/AXqmNi+6IvuiAPkeCxcO3ZCTqxinSX4R2mxCelMbGISCvo76yegac UIWlget2NiTUHT6/Hq++mHgdXn3RocWvJNEQInZEh8XZcyYrTBU5ZHWHjsHZ9+0/Ijfr S58Sq13SGFFyBvwWmMySvrNH1M9ikw8gKTHEH02QCAeQiMOdwYwF3tU9vOJVrwr53Isq ZXRVWWCc9WQYIm8t19+7QhKChU+f+wykF7zVwpcL7t0n5yho6Yh4yc6FSddgD68mzAaR /PJ5aFQKCwozVkzLSRsCFgS2smMk/x1NmHRFyl5asfHh6y5/GKQsa5Zj2XNPWFX1XeyA O/lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:dkim-signature; bh=qYtlz9NBah2bm8PXOapjlrXTNymaXXmA4ptPRA6y2hE=; fh=K6+MqukJu424GLTawl/nAnK/X6jgUInIAW+9ZScqAD8=; b=eV3jOYutZNeF3n23aFie/vhi31Sx1GOm/CiiKZTWmfjMyHaJ4oBd/Nl4JPaygykd9f Skoa8c/wZs2W85LawzzXJuEyoo+Di3NdEh1ggigFcj6BD9D09dxKUvvF26hkuopoyX2X q8sNSw6y5bE8HQLBAempecO/Ne1uPZ2SrV1J/n+0O3+HlYxAYB/4ZR2/wIbjcGV/kraO r7XFOD8tnBclSrgcr02mBjdU1WbDnE+Rar+EU7Ml4vUdmZP68LPAGMJ3SxCKOaN7Pqi3 xUpKIbbFCss8IkhMa42IVpCYo3NCtDFI9wqhkIHe1I+LZfOuF0LxWxvEwyeDyBegVCWR ofCw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781779445; x=1782384245; darn=postgresql.org; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qYtlz9NBah2bm8PXOapjlrXTNymaXXmA4ptPRA6y2hE=; b=a4Z17PZrRVJGnNEMQxEeJbfD/FT2y9Db3jeKzzBKsqpyulWFT+ZXrk+LIqIdsaaLlI A0ll9Cm53iNuqtKUlCjeO6HsLNFF0MUI1StqdZzo1fmViPO4RfrOl+FGlcIVpHdAkOCZ +kU3eNoaBa95/VNzVGXOKJfngIj81Er9E1O3d5maPiE2LgGrKOtfLUy0c7OPjTReanNJ /5+T0AzpPGZQ72oOtg3iS/ZDVuRZHGNb1uvswaO74v7PGYkccvIw3hAY2Eb7Cdm8NjQL hqK/3GE0tAAe2xkCuXmcYzrIWbZMUH1qSrZloekHIPNeDsKINLzfGieaGM8ks+5uD2n+ uuqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781779445; x=1782384245; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qYtlz9NBah2bm8PXOapjlrXTNymaXXmA4ptPRA6y2hE=; b=qIOjPSnsJoE96vni1Nf8kjwRQkdxLbtrY4uh2nPJQXgEHpPdFJebaM7149L9GfeFfB 80CWx56/QbOC8bNpXscTBWb1mt0pYPcjmgrd/77fRwMRg1tA8l2qrjl9WmFRI+/x/Jd/ QRcjX94SnE1jsIenjuAYEHonN89k9PfqYVo58kUOeAlsoLEmAW3yor1p30NsyVZupShb HD/BbttLgQVw9sNDd05TKJd89Fv864kjQ+9INi9yWjHve4RJOf+GRXmUcKlUtMt2RjYi 3E1KtFPv/E2s7a6OritvBNjmNI6BdlW2b/BwKjk9BYDlhFg/ouXQcDfJ6tgwcJRteAZB 7qkw== X-Forwarded-Encrypted: i=1; AFNElJ9X1usgUrgkoixDFVSa1l9j37NJ+pTcnQcD/Qsj8vXUnUUJhDxox7mapC1dfXoWpAMMn9rIzvwuD3oXSvRm@postgresql.org X-Gm-Message-State: AOJu0YzeHHhvtoRqiArcryppJiUXqiSaU8IfASSrecEwW8/RtB7erXps yCffOjbfdzCrtnL+Gu36NMp1MW2z1K1fwjAp1yvQkDRFuV478251trINuB/fqc3mP+YNL+yYsR5 tjFbCzcXZVexfyykhUx+jjY6OqvP1UaE= X-Gm-Gg: AfdE7ck1Ei1vZ7ImYLhPhDlmX9BJ/A0UbPPmNipPXyYxzJqJM152dofIkGtp8mqwxYr OgeOQkjd5DjSRlOUrF+Thy2jtv5sSis8A47Z5Aehv80+mO+ld9CCw+rZ+RpZV9Fc6ILZPJncPQG sNcD1/nq3s/B/gbhfh0l0jADwokXnNKwv1sdGFyUsK5nNrk2n+r1nGRdUK+CCRnn3EN6kXTWx5o 6hTlOZ/lnd2vXdaWeHGkQfoE8MIUE9MwUncNafKw83VCtcQnvQ12BxT2ehczqaW4aD3kAA+KU80 Q6heTLftF+d8ycVc+aQYqq87Cdw7Lsr+8+6w6UmVpff3j1vFiEUIgfLVL2idVgUht9ty/aBPtq2 yxttfVR1hjtE= X-Received: by 2002:a17:907:25cc:b0:bef:3ab2:bed1 with SMTP id a640c23a62f3a-c0732eefbb7mr169619766b.16.1781779445126; Thu, 18 Jun 2026 03:44:05 -0700 (PDT) MIME-Version: 1.0 References: <20260617.221327.809417533229490738.ishii@postgresql.org> In-Reply-To: <20260617.221327.809417533229490738.ishii@postgresql.org> Reply-To: assam258@gmail.com From: Henson Choi Date: Thu, 18 Jun 2026 19:43:51 +0900 X-Gm-Features: AVVi8CeiPg6_8mY_zNViEJm0s4NNsG9glhriyvEJqyJ4dyd8G4MajpzsLDBl5mc Message-ID: Subject: Re: Row pattern recognition To: Tatsuo Ishii , jian.universality@gmail.com Cc: zsolt.parragi@percona.com, sjjang112233@gmail.com, vik@postgresfriends.org, er@xs4all.nl, jacob.champion@enterprisedb.com, david.g.johnston@gmail.com, peter@eisentraut.org, li.evan.chao@gmail.com, pgsql-hackers@postgresql.org Content-Type: multipart/alternative; boundary="000000000000e51b9d065484da28" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e51b9d065484da28 Content-Type: text/plain; charset="UTF-8" Hi Tatsuo, Thanks -- I'll go in this direction; your sketch has the shape of it. > Yes, I think the direction is correct. Probably the patch would someting > like this? > > + update_reduced_frame(winstate->nav_winobj, > + winstate->frameheadpos); Right: drive the match once per row, up front, instead of letting frame access drive it. That's the plan, with two refinements on top of the sketch. First, a small refactor: I'll pull the reduced-frame loop and the mark advance out into their own functions, called once per row before the window functions run -- so the match tracks the row scan rather than frame reads. Second, the mark: I'll advance it per NFA row from the match frontier rather than the output row, so the tuplestore is trimmed as soon as the match is done with each row. Thanks, Henson --000000000000e51b9d065484da28 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Tatsuo,

Thanks -- I'll go in this direction;= your sketch has the shape of it.

> Yes, I think the direction is= correct. Probably the patch would someting
> like this?
>
&= gt; + update_reduced_frame(winstate->nav_winobj,
> + winst= ate->frameheadpos);

Right: drive the match once per row, up front= , instead of letting frame
access drive it.=C2=A0 That's the plan, w= ith two refinements on top of the sketch.

First, a small refactor: I= 'll pull the reduced-frame loop and the mark
advance out into their = own functions, called once per row before the window
functions run -- so= the match tracks the row scan rather than frame reads.

Second, the = mark: I'll advance it per NFA row from the match frontier rather
tha= n the output row, so the tuplestore is trimmed as soon as the match is
d= one with each row.

Thanks,
Henson
--000000000000e51b9d065484da28--