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 1ucZck-00EP0V-PS for pgsql-performance@arkaria.postgresql.org; Fri, 18 Jul 2025 01:10:54 +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 1ucZci-006UZT-OF for pgsql-performance@arkaria.postgresql.org; Fri, 18 Jul 2025 01:10:53 +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 1ucZci-006UZI-C3 for pgsql-performance@lists.postgresql.org; Fri, 18 Jul 2025 01:10:53 +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 1ucZcg-007qvr-2m for pgsql-performance@lists.postgresql.org; Fri, 18 Jul 2025 01:10:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=guidewire.com; s=mimecast20170721; t=1752801049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=fm3PwZSXGNpq9DrdSArFbJCje0BABfa9ZiBYLRzmnFk=; b=bOA4UTVxOxhwDFl1Wdf3Xqilchak78H51YotH3W/F1K4OQvJjPW0ltPDHVFR7CkKGceWoL EWCE1OK5Cbb3tf8fHcwxVMfXyqoX4WgZG9aXO10dJQ1t6aTFm7kcPZfZ0idUjH/RDXSlIF aIkIahJTHcFARA2BCTJdBr68vvOp7QTCsvtcaW89lKbLSMO8YoagVHVp4lPtqyQAhsFCcn c2WzUk4p8PKGwpNfdGHxCUJAJPrLIB6ZsSCLm7jTu6Ey55Soi/QNBkan5lEBBMilx8XL1w G1ey5ylYsmwfDXR6YEO0991At3ZHFSMrHHkCoa3kHYeERAzqhmfR32wz1yv/Eg== 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-47-lHcaMwTHN6eI_mrFotNfEw-1; Thu, 17 Jul 2025 21:10:47 -0400 X-MC-Unique: lHcaMwTHN6eI_mrFotNfEw-1 X-Mimecast-MFC-AGG-ID: lHcaMwTHN6eI_mrFotNfEw_1752801046 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-712a3ee12e2so22336827b3.1 for ; Thu, 17 Jul 2025 18:10:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752801046; x=1753405846; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5+MjO0Yt54Lg/9gh/kk2HJt55Uots1agSpK1mYCjDD4=; b=ueiB0ZuSkkWiHLRPL+fMnYcROie5TXKEmI+qttbghUPk55gYZz9zFWBNfDYND2r1jv Xz3lueXjmguu+Adq6K54dHJH9rqE4N7rX7f6FgCYso/Fa4PQk7szdZqkNarkvIotAzcf M7smHFoRUk1egYPjN/3sk/xKQLFr0FzvCyElgnbjLA8C8bTD4pHlMG+3a7g9Dh+jDk6x 03hewm8Y5fqjdm+mCgi+dMvRVohlFKS/vDETznfpIjDbGQKx4214sqvBj04eHfxdCENv hhm2Bqzah/opWlzQvmTTmq01+UNaaHNpPyDLX0WUyJbwuaDfd/ZSnKgzyq+t1H1SCF/c TppA== X-Gm-Message-State: AOJu0YxQ94Uhpb6Ylhjxo5fM/Goy++HUP2CC4sxaVS+dmOx/tloDsfye bqtRH5RkCJt0ypfmzmZFGDkt2rKkef78LoQD7Q1IuaZDiJL38nrT4bw7H9BJ3gWk13HAOfCw9LO 1u79oXJRjjCUQafSVRiI3jNQldu6b9T9w93Nc1uVqwP891RZqYpvQuLqndnaf1FbiNG2Ixv7vIG 2M2ifNn+SLBr9seJj0laLi7RDciiQoPrtJlYOmV0TOSv/tXwu1PckUSYG4NIpzX/1fzBaoTS4n6 CW2bRbKyNVVqg85vWCIgkyU+FwmB0pc/AS3P+1sRHR/0AoSx1y7n3Qv0yUsh/DwBT+cwoP2MuE8 4oyd3Kc= X-Gm-Gg: ASbGncvpBqkqV3cQIEzJHiaU9D2M1dSJXGn51ber05yOOMkHgAlGscGzImH1vIUP4fP IFavAJoyf6/Jhw+oxnalZbXETi0Cx+aFsPjXxCjP16SVk9U5rwy5nm/PwlHaGOvD0aupGGcN7ff wNDHg4Eq00hESLFUcC2T3K X-Received: by 2002:a05:690c:4b11:b0:711:6ea1:8d12 with SMTP id 00721157ae682-7184f70cfb2mr79994887b3.1.1752801045839; Thu, 17 Jul 2025 18:10:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEBHaqK6YFD64d6GJ1UOFqV3R0/UOm/lhOchnx5D0+pcnO/CaSpFqGXyRLV4c1CliPNp5BY2MmEjoQ6yFAG5Y= X-Received: by 2002:a05:690c:4b11:b0:711:6ea1:8d12 with SMTP id 00721157ae682-7184f70cfb2mr79994517b3.1.1752801045271; Thu, 17 Jul 2025 18:10:45 -0700 (PDT) MIME-Version: 1.0 From: Jerry Brenner Date: Thu, 17 Jul 2025 18:09:50 -0700 X-Gm-Features: Ac12FXx8xMP8tVth-XPymcp8P3b81IZxEGod_YSbf9DvfRn2Hg_j4EMQwcrssv8 Message-ID: Subject: Is there a way to identify a plan generated by GECO? To: pgsql-performance@lists.postgresql.org X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: dydXh9hCQT0yqy95-45_ECmnMHIMJUUAHtgx5gO0fpI_1752801046 X-Mimecast-Originator: guidewire.com Content-Type: multipart/alternative; boundary="000000000000aaad0d063a29cbb9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000aaad0d063a29cbb9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable We are on Postgres 15.5 (Aurora) and capturing query plans via auto_explain. We are seeing a large number of query plans for 2 queries that have 12 tables. Every fast (or "fast enough") plan has a left deep tree and every slow plan has a bushy tree. Is there a way to determine if a plan was generated by GECO? We have from_collapse_limit, join_collapse_limit and geqo_threshold all set to 12. (There is a COUNT(*) above derived table - could that be somehow affecting this?) I've manually explained plans and haven't seen the problem, but then it turns up the next day (with the same parameter values) with multiple execution plans. One more data point - each of the individual query plans is executed in a distinct time range (during the customer's test). (No environment changes between these time ranges.) The only overlap was with one of the queries where a single execution of a generic plan occurred during the time range that a different plan was being executed. (The generic plan was the fastest plan out of all of the plans.) --000000000000aaad0d063a29cbb9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We are on Postgres 15.5 (Aurora)=C2=A0 and capturing query= plans via auto_explain.=C2=A0 We are seeing a large number=C2=A0of query p= lans for 2 queries that have 12 tables.=C2=A0 Every fast (or "fast eno= ugh") plan has a=C2=A0left deep tree and every slow plan has a bushy t= ree.=C2=A0 Is there a way to determine if a plan was generated by GECO?
We have from_collapse_limit, join_collapse_limit and geqo_t= hreshold all set to 12.=C2=A0 (There is a COUNT(*) above derived table - co= uld that be somehow affecting this?)

I've manu= ally explained plans and haven't seen the problem, but then it turns up= the next day (with the same parameter values) with multiple execution plan= s.

One more data point - each of the individual qu= ery plans is executed in a distinct time range (during the customer's t= est).=C2=A0 (No environment changes between these time=C2=A0ranges.)=C2=A0 = The only overlap was with one of the queries where a single execution of a = generic plan occurred during the time range that a different plan was being= executed. (The generic plan was the fastest plan=C2=A0out of all of the pl= ans.)
--000000000000aaad0d063a29cbb9--