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 1w9zFZ-001xZQ-2Z for pgpool-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 05:45:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9zFX-00EfVa-0v for pgpool-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 05:45:19 +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.96) (envelope-from ) id 1w9zFX-00EfVS-0B for pgpool-hackers@lists.postgresql.org; Tue, 07 Apr 2026 05:45:19 +0000 Received: from mail-yw1-x112b.google.com ([2607:f8b0:4864:20::112b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9zFU-000000012Rn-1DnY for pgpool-hackers@lists.postgresql.org; Tue, 07 Apr 2026 05:45:18 +0000 Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-79827d28fc4so38047177b3.1 for ; Mon, 06 Apr 2026 22:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775540714; cv=none; d=google.com; s=arc-20240605; b=iuQmClBvh2i0hjgGieNmyc03lSJEcCcujaNn0G0ofR02SEGXfVpVPrONnAaorYlID2 +RO4e17WL1Ti2jGq5zJvnhtgr8CkUpRDtyhhRvQVncioFsXgMouxxfU4u0fPbP3KHGbO 5xYPA6J1AqGxSxnhA5/mjnEesU8Gyo5r45rdEjjc/SvkJjQcUGJ9KNAFbNmGmDIpx7nb zivSDybEyOWn1c8e2xKPf9N6xriI/OJr48zkWpomQzhLhep8SjpxFfpDLf6kQE5l2YCf lnKTuV+asNSSIMy9OtJPVL1rIOuRBLfFYKACvQ3zbDoZDERV0q3gP9eeuIzO/0HLNZcC 5rdA== 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:in-reply-to:references :mime-version:dkim-signature; bh=D3fn/ymO0hemCFasSVddqlm0A6f1eyP6q1f55bqm6ks=; fh=m3oiE62fRN5J1XaE+5vpHZRIgCyFefxVI0mFw3d8yxA=; b=WTfrMN+fV7X2b3MWt3lhfeqiQMQUKeUJrkY8sQLlju1d7TrlbDUfYtRISfEUHVrL06 mf6DqkJ7Zvi4LlQlaNDjLXov+Me8XI4Doh3yIYzpgJjlmG/tPq8WK2lVE8EVol0n90O7 kc2AB7tbVMic0T1ET95R2tz/Cma+y/ojaIYDzu7d+Dpf45uwsH0xrg21Tb57uc5MNHqZ dQWrK2XtVMpBugTL2+jkzaegOtZ4/CO6G7RtJ1pIwOERYDgvbNjTmvR6FG4k3k+8PNRU Uo7h6zLqIW0OrSiZ//kFaBYkGMX5Zto1iLBKeThcEnRAfQMAkX1zN3eBG1T1zfRse1vX lKxA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tailorbrands.com; s=google; t=1775540714; x=1776145514; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=D3fn/ymO0hemCFasSVddqlm0A6f1eyP6q1f55bqm6ks=; b=bBR6J26o7ZHrgEsob6BTUwSPIje4+jFLRNEhFGNqrbqVJLVGuWFSn6UzVa6v9bUf5Z pm+XMsr2dGhoBPI8eIdZIzR1sGrOM58Y9nTYFI4YAlH+4HLnobyrm6S9dItyJhdE8yxH DYIP5Pu07OoPR/53csYzmPrVlJg7Et4jUif1VeKa2Uv2mfrUworyicrP/CnZKkj/wXfB 6X2S9RcI0texwXLgMlZ272GcpfkC9LaYt6gCUEZ8btEh1A4XM331AHbiSt6iCEKWVCKl clA17udMDxayVoD70BLc3qEGC1BmSrARkSMcDVs9z5UyJVTWHRHAW28M8SpgY+ODoNpQ lC3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775540714; x=1776145514; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D3fn/ymO0hemCFasSVddqlm0A6f1eyP6q1f55bqm6ks=; b=qudXPgHO2X7mTRVyf2n4Fpv/GV++zIOE2n+MVASz1ASwqzkpIs3xQRkI01SqDvGf6P 35TZ7lXdBNc1clJe5JudBUvz+Ndg2I5xwWqiBLBKenBLdAi/dk+V4rIaKzyFEvNFbaP8 VFdqCyfsHj6xbyApCOvhl7DQaVkV+oca5YtzhKCW9jIpxlH5idFXuqVicLdLDyNlZVWh cfTQz+ReNOZxhhbqNl+5QYPD8E/qBsRT0ifylH1na7dRtJl2i+sZgjG9WTDEYGnmqffr iPxsyqhXRPzDksskxKj5oXNe0EPCkZZVyaw+comlZfH2twTIoHZgF9rozdRpT3ZjacZY 7ByQ== X-Gm-Message-State: AOJu0YxBmfnMfD4Bv9T5ykWq+6UXyzZ6txdIAG1nXkzGiv/XlJ+Xv2Yy ool+s3IonPzSSVnqFzalJL+mb+iU71OMDF4IEGWmTR2yWwXVVnuYcNSjAlEuCmPaf5LQ3/PxLZF I9j2Ozrn9HhUNpBQ3b4+4qDzmuAoDcmv249wZkpuHZw== X-Gm-Gg: AeBDietL+FNtBbKeVlXpknzJAf/QOUqG6Dno3c/v/+PfgtMGAaJn6IwcE3DAyIujbEc PxjfPwKo1JBuG6YzFCvmsnYU/ShunkcXEgtIbfpCt2QWfSCJzN9xFQ5WO9FK0djjRErHqcjmkQ3 OEgVOpHnIa15dEB+36SJLmbsgTu8VkMyX1Ql9gs2onYpHCYj9NZJpeFtX1cyYSQPjh/kBSuFVp/ Lj5jnH0vXOaDbTdDhBOJjrEUeIDhDZkJqGBKcPpHZnn8x5Oz7uzr1/p6coaAGFKNQzEgOIBA77D XUF8Tv5vBa28r6Dyx4A8k+o9WyiZ76b85uHYpIbz0rjVjYqPMazRxikcWaVGTxl/2lLCHgBFcxN 2dEsnXH4gxJasdQgF4ddbgqDq3yJyBGMKSGO6 X-Received: by 2002:a05:690c:298:b0:79a:4419:71bb with SMTP id 00721157ae682-7a4d6e21e21mr143791267b3.21.1775540714254; Mon, 06 Apr 2026 22:45:14 -0700 (PDT) MIME-Version: 1.0 References: <20260323.141315.1197840295971477812.ishii@postgresql.org> <20260407.090802.1335576118037412011.ishii@postgresql.org> In-Reply-To: <20260407.090802.1335576118037412011.ishii@postgresql.org> From: Nadav Shatz Date: Tue, 7 Apr 2026 07:45:03 +0200 X-Gm-Features: AQROBzDIqZmNHzfAIVL4VdDF_fFBAzEEKOvZbQyg44xABm5fiBkYVSSYj-3yHBY Message-ID: Subject: Re: Proposal: Recent mutated table tracking in memory To: Tatsuo Ishii Cc: pgpool-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000008ed958064ed849ca" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008ed958064ed849ca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Tatsuo, Yes I ran into it during the work on the feature. Let me know if you want me to separately submit it. Cheers Nadav Shatz Tailor Brands | CTO On Tue, Apr 7, 2026 at 2:08=E2=80=AFAM Tatsuo Ishii = wrote: > Hi Nadav, > > > Hi Tatsuo, > > > > Thank you for the thorough review and the fix to the tests!. Here's the > > updated patch addressing all your comments. > > > > re - replication_delay_source_cmd requirement > > > > Good catch =E2=80=95 the feature now also works when `delay_threshold_b= y_time > > 0`. > > I've added the TTL update call to `check_replication_time_lag()` (the > > pg_stat_replication path), not just > > `check_replication_time_lag_with_cmd()`. The docs are updated to reflec= t > > that either `replication_delay_source_cmd` or `delay_threshold_by_time` > can > > provide the time-based delay. > > > > re - Documentation compile error > > > > Fixed =E2=80=95 the xref was pointing to `runtime-config-track-table-mu= tation` > but > > the actual section ID is `runtime-config-table-mutation-map`. > > > > Thanks again and looking forward to hearing back from you. > > While looking into your patch, I noticed that following part would be > better to be committed as a separate patch as it's actually a bug fix, > not related to the feature: query cache is not invalidated if MERGE > statement is executed. I will take care of it and get back to you. > > --- a/src/query_cache/pool_memqcache.c > +++ b/src/query_cache/pool_memqcache.c > @@ -1305,6 +1305,12 @@ pool_extract_table_oids(Node *node, int **oidsp) > } > return num_oids; > } > + else if (IsA(node, MergeStmt)) > + { > + MergeStmt *stmt =3D (MergeStmt *) node; > + > + table =3D make_table_name_from_rangevar(stmt->relation); > + } > else if (IsA(node, ExplainStmt)) > { > ListCell *cell; > > Thanks for letting me know about the bug! > > Regards, > -- > Tatsuo Ishii > SRA OSS K.K. > English: http://www.sraoss.co.jp/index_en/ > Japanese:http://www.sraoss.co.jp > --0000000000008ed958064ed849ca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Tatsuo,

Yes I ran into it during the work on the feature. Let me know if = you want me to separately submit it.=C2=A0

Cheers

= Nadav Shatz
Tailor Brands=C2=A0| CTO
<= /div>


On Tue, Apr 7, 2026 at 2:08=E2=80= =AFAM Tatsuo Ishii <ishii@postgr= esql.org> wrote:
Hi Nadav,

> Hi Tatsuo,
>
> Thank you for the thorough review and the fix to the tests!. Here'= s the
> updated patch addressing all your comments.
>
> re - replication_delay_source_cmd requirement
>
> Good catch =E2=80=95 the feature now also works when `delay_threshold_= by_time > 0`.
> I've added the TTL update call to `check_replication_time_lag()` (= the
> pg_stat_replication path), not just
> `check_replication_time_lag_with_cmd()`. The docs are updated to refle= ct
> that either `replication_delay_source_cmd` or `delay_threshold_by_time= ` can
> provide the time-based delay.
>
> re - Documentation compile error
>
> Fixed =E2=80=95 the xref was pointing to `runtime-config-track-table-m= utation` but
> the actual section ID is `runtime-config-table-mutation-map`.
>
> Thanks again and looking forward to hearing back from you.

While looking into your patch, I noticed that following part would be
better to be committed as a separate patch as it's actually a bug fix,<= br> not related to the feature: query cache is not invalidated if MERGE
statement is executed. I will take care of it and get back to you.

--- a/src/query_cache/pool_memqcache.c
+++ b/src/query_cache/pool_memqcache.c
@@ -1305,6 +1305,12 @@ pool_extract_table_oids(Node *node, int **oidsp)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return num_oids; =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0else if (IsA(node, MergeStmt))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MergeStmt=C2=A0 *st= mt =3D (MergeStmt *) node;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0table =3D make_tabl= e_name_from_rangevar(stmt->relation);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else if (IsA(node, ExplainStmt))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ListCell=C2=A0 =C2= =A0*cell;

Thanks for letting me know about the bug!

Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
--0000000000008ed958064ed849ca--