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 1ucl1S-00Gjyz-6d for pgsql-performance@arkaria.postgresql.org; Fri, 18 Jul 2025 13:21:10 +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 1ucl1P-00CQ3l-1R for pgsql-performance@arkaria.postgresql.org; Fri, 18 Jul 2025 13:21:07 +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 1ucl1O-00CQ3d-Mj for pgsql-performance@lists.postgresql.org; Fri, 18 Jul 2025 13:21:07 +0000 Received: from us-smtp-delivery-113.mimecast.com ([170.10.129.113]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ucl1J-007x3l-39 for pgsql-performance@lists.postgresql.org; Fri, 18 Jul 2025 13:21:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=guidewire.com; s=mimecast20170721; t=1752844858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5r1H6z9uQvEFTBzuAOfXwNgSoOzMX5++QgfZOhfFnW8=; b=kA2bXn0RcepR6aiIIanKmm80asaCJDWXvdtibFjkz3fPlU6pczGAsEHfPqmmM2qBVyLv9o gXeHKdE7be49KYpFmXdiDtuFF/hiwTyOG+wi61o47XQ0aCNDVdrH+zuO3cwvWyf8uuGS/i 2jB9zGAU5yWIZZ69XpGPwwYrTUs04Tc90s9DqZEjT71X1BLQTWyso4qZN5QAnOGpQt6TZn PiLSelFvCx4qz5+I6LfBJ8+iUSQruXAry777SeXz4OmcGK/+zeAoEd4Lp7NTgC7VomdUpG 0jIcM/kBkjkDSHik5tftZ0GcXnQqpySGvOG6tgC4dsXJz2v2TZlPr5z2QrX4mw== Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-147-_MHCMVpLPtGCSIURLawbwA-1; Fri, 18 Jul 2025 09:20:57 -0400 X-MC-Unique: _MHCMVpLPtGCSIURLawbwA-1 X-Mimecast-MFC-AGG-ID: _MHCMVpLPtGCSIURLawbwA_1752844856 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-7111ff9f2d4so25428027b3.0 for ; Fri, 18 Jul 2025 06:20:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752844856; x=1753449656; h=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=4QSyRfEKiqOenvNbV6Vz93f6Qg2eRNCtnnHt6Twzsyo=; b=XD4MpBH9cwIwdiIS9/v5K80MJplg4qZqmL/z8m6EEl3Mkq2CmqxADWyMol6iFXPfpD 82Nc7nnoK3fvjQe8VagM68jjcuetE6Q+Q0EyG5N1d1X0FyAai3tMyTn315xGBhL+e/q5 BEYnF0Fa7orKf9p6EyiPjs90EytpEYlZG26gtSLVt/rI1IHeJBa9ryrvmkC4M6wiZ8r4 AUC5r1u/71NGljwJPcIJuAW9Gml6FxWc2KtoZorZZEQRrwjfqmdj4of4TY2oizh0Un2c 7HxKLjI3AhdUIWE16rc53DeWRVcJUXR+6090JLp5B9cbLEQkzt1uFi6hzSRfTjh3bBvz XN8Q== X-Gm-Message-State: AOJu0YynuxtorBF2dFSIoGDNV9HlzLt8Qy/UenmLJscj94Gcz+rQnWXJ VQ+wjB3CzuwHgelx4a82+R01X59FWDZFep9Dwl4RgKE/X+1M2RB24hvhC2pDJuq3OjHaBBsP8EN xKY1sNepYVurPZMS+VsZCPoxhDZhLg+VZRDDgjjfZZw0oKYsJyca99z6Fm03go+2YnBXka2Na4W 153S/cDzBHc/ohGjoaH5E6AKMOIf2qM9w7T7qk8jHZOoKVd8OmBmEbxVSVfHqYGqWkDB7QLyzsT x7voF2EvgC+R8cM48GutlVBMqTU2P4kE6Lu4Zmbogtt2OufsalRhOzhE4NrIgrY/RXEKV+E X-Gm-Gg: ASbGncu1oS/ysZ4PujcIT2PzrK0MKcOfdvDW/T6EqTQhUhBLPEcOkP77elj5i8DnAcm KkCmP7HBMz5I6B0m4aUFXI6OmJv/QzFk2YtZwANVQaGbMZBCrNf/qjoS12aSGAKa3FNF5MZAC6W 0soezex39io2TXv3iM2Lbd X-Received: by 2002:a05:690c:b12:b0:70d:ffaf:48e1 with SMTP id 00721157ae682-71834fd332emr133977897b3.9.1752844855836; Fri, 18 Jul 2025 06:20:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4Ro6Pc6YSfyrtFZTWuGM67QxmpiLFPqKK2H1gWnme+2mlaiSxInjq0mwypo/2I4EuXc6/Ew5Tn/p7iBNBtLI= X-Received: by 2002:a05:690c:b12:b0:70d:ffaf:48e1 with SMTP id 00721157ae682-71834fd332emr133977317b3.9.1752844855222; Fri, 18 Jul 2025 06:20:55 -0700 (PDT) MIME-Version: 1.0 References: <1761501.1752803865@sss.pgh.pa.us> <1774625.1752808221@sss.pgh.pa.us> In-Reply-To: <1774625.1752808221@sss.pgh.pa.us> From: Jerry Brenner Date: Fri, 18 Jul 2025 06:20:03 -0700 X-Gm-Features: Ac12FXw30059nzjgAI9y4jPWfU-RqugOqR5HXJI_WldDScfN-WVuAVmE2j7X2bs Message-ID: Subject: Re: Is there a way to identify a plan generated by GECO? To: Tom Lane Cc: pgsql-performance@lists.postgresql.org X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2r1fAe2g-OyTN6zS4_DElsiyVjMdW8zQBYm4bMjPJLA_1752844856 X-Mimecast-Originator: guidewire.com Content-Type: multipart/alternative; boundary="000000000000f1abc3063a33fe5d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f1abc3063a33fe5d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable We just jdbc and bind variables, so we are using PreparedStatements. plan_cache_mode is set to auto So, it sounds like there could be plan caching. (I wasn't aware of that.) Is there any kind of running counter in a system view that tracks the number of executions of cached plans? We are capturing the plans via auto_explain and limited to the explain options available with that path. Is there anything in the plan that would tell us if the execution used a cached plan? (My manual explains does not use a prepare.) Thanks, Jerry On Thu, Jul 17, 2025 at 8:10=E2=80=AFPM Tom Lane wrote: > Jerry Brenner writes: > > I don't have any background with the randomized search. Does the > repeated > > pattern with the same plan being executed multiple times in a time rang= e > > and then the plan changes, never to change back, match the expectation > with > > the randomization? > > [ shrug... ] Insufficient information. There could be some plan > caching going on that contributes to this effect, though. > > regards, tom lane > > --000000000000f1abc3063a33fe5d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We just jdbc and bind variables, so we are using PreparedS= tatements.
plan_cache_mode is set to auto

So, = it sounds like there could be plan caching. (I wasn't aware of that.)= =C2=A0=C2=A0
Is there any kind of running counter in a system vie= w that tracks the number of executions of cached plans?
We are ca= pturing the plans via auto_explain and limited to the explain options avail= able with that path. Is there anything in the plan that would tell us if th= e execution used a cached plan? (My manual explains does not use a prepare.= )

Thanks, Jerry

On Thu,= Jul 17, 2025 at 8:10=E2=80=AFPM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jerry Brenner <jbrenner@guidewire.com> writes:
> I don't have any background with the randomized search.=C2=A0 Does= the repeated
> pattern with the same plan being executed multiple times in a time ran= ge
> and then the plan changes, never to change back, match the expectation= with
> the randomization?

[ shrug... ]=C2=A0 Insufficient information.=C2=A0 There could be some plan=
caching going on that contributes to this effect, though.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 regards, tom lane

--000000000000f1abc3063a33fe5d--