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 1uca8z-00EUvh-8d for pgsql-performance@arkaria.postgresql.org; Fri, 18 Jul 2025 01:44:13 +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 1uca8x-006hC0-4E for pgsql-performance@arkaria.postgresql.org; Fri, 18 Jul 2025 01:44:11 +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.94.2) (envelope-from ) id 1uca8w-006hBp-Om for pgsql-performance@lists.postgresql.org; Fri, 18 Jul 2025 01:44:11 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uca8v-008M9S-0m for pgsql-performance@lists.postgresql.org; Fri, 18 Jul 2025 01:44:11 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3a6cd1a6fecso1367479f8f.3 for ; Thu, 17 Jul 2025 18:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postgres.ai; s=google; t=1752803048; x=1753407848; 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=ZdN0buVhsDDCZJI5lLYyvUIQU/3nkXgfDVbeNp6ZizM=; b=OPoV0rZILDJYKtX/Bydu9XEy2evsGVJDEk49rfeafMvzvjeIHiMs8ebmrgYWOKn9ZC uOQ9HZa8oQK45rRPubfS40/1UTpfC/cSBco6f2xFWBZ1lerFNwiuk0AaHwpkyncJ+AYe uGoadB6dajSwUf1HfntjQRVxDUrLCNDf0APa6bkwkpALoUQIrzDR/J/zTpCKHHuZnRbw wAFriWOCjDvPriksAn+1z18Vzo5UxsR2zDgosSocxkDdyMRvVDi2g3h0kkH7Nqe2uwAZ ZyDKz61E9sqYpdgYbMlSYVb382Be2nBkMlHbXtPoFXAuutOroJhXHgb2FW/B7WR5YvLU ah8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752803048; x=1753407848; 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=ZdN0buVhsDDCZJI5lLYyvUIQU/3nkXgfDVbeNp6ZizM=; b=dX3RS6zVXw5eyjWX+tIhLxZG8jsINIdD8Q3pa7oaZn7zYS4uz9lieo1NAj2o3mzEC4 e/ewt4jGZJHUj5cfuolrWn8E6aFRImepOL4mMpo04AHRP45SfUfdYhXOiGYhbqHck8f+ DxKahXxbzBbxyWOJrZ7LZjKFjOEZB7UCvPcWlCEzB1UHcO00MyE/F3oUMswGCF5JRZYO NKMkzLAM6V8SWTakqrOzL12kBCteUpsyO1WlRqBkl4RL8MvE+GBWkPib52oiqfQ9A0en imcXMhkMCsrZMZuTUnfPSgrlOO6WczJ+JG29VNWZp//7NzZ+def8BCGBtfVpXgbGzvJ8 lBOA== X-Gm-Message-State: AOJu0YyJJdgaVLbRSu0gR3zJUsh3RZpwEoLpQI8CEmkP5dZkB8DCXI9V 0MDKrKkGgeNAEsCAWZ1/vyO3qOJ1Do/I0QLyYDlJUqe2P+yh+T4a6FJsTACxdAyomZFYyErtCeN C62N1mzb7i0pLlp+/dtG/YElgmhoMn9x6YN31fbb/PlM07x5JlqzV714dqg== X-Gm-Gg: ASbGncvmjvTkM+ItHZeztMIjgceRNj2L0sljulPt3AXRs1IIagXkGto7FfjtfIDY0Li Fg3/JSbqYqBtT1pmbkG/N5t7RQ43LTmiM8g8H3QAbP1GluB3Md/1R5ScAkJK2cd9W5I3Va2re97 Ja+C3OdaEraeWCEpFL/YO+R7gqRJLJisNeYBQjAy3++NzkYgPbeT9/bzvOBo2k0g1DZ719wv3+0 0PbtOTG X-Google-Smtp-Source: AGHT+IGfeufjdw++lXDwyHcyqx/zWaeI233JB0tT1NBcBB7Q8wN7xuOMAyFHdeeegSXRzvzoBEHNHyL5mrWPXBDRPEA= X-Received: by 2002:a05:6000:1ac9:b0:3b6:d7c:f4ce with SMTP id ffacd0b85a97d-3b60dd88801mr8254654f8f.54.1752803047555; Thu, 17 Jul 2025 18:44:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nikolay Samokhvalov Date: Thu, 17 Jul 2025 18:43:56 -0700 X-Gm-Features: Ac12FXyVwporz5yz6WmD5_Cnn1U61sDHvzAS7eHecgNC5mdABX4ZFUd8sEy7AfU Message-ID: Subject: Re: Is there a way to identify a plan generated by GECO? To: Jerry Brenner Cc: pgsql-performance@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000002d9e5063a2a4317" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000002d9e5063a2a4317 Content-Type: text/plain; charset="UTF-8" On Thu, Jul 17, 2025 at 18:11 Jerry Brenner wrote: > 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. > I'm not aware of ability to see if grow was involved, but with Aurora, should be able can provision a thin (CoW) clone with PITR to a specific point when you suspect the plan in question was used ("slow") -- and study the planner behavior in detail, experimenting and adjusting planner parameters. Nik > --00000000000002d9e5063a2a4317 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Thu, Jul 17, 2025 at 18:11 Jerry Brenner <jbrenner@guidewire.com> wrote:
We are on Postgres 15.5 (Aurora)=C2=A0 and c= apturing query plans via auto_explain.=C2=A0 We are seeing a large number= =C2=A0of query plans for 2 queries that have 12 tables.=C2=A0 Every fast (o= r "fast enough") plan has a=C2=A0left deep tree and every slow pl= an has a bushy tree.=C2=A0 Is there a way to determine if a plan was genera= ted by GECO?

We have from_collapse_limit, join_collapse_= limit and geqo_threshold all set to 12.=C2=A0 (There is a COUNT(*) above de= rived 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 multipl= e execution plans.

I'm not aware of ability to see if grow was involved, but= with Aurora, should be able can provision a thin (CoW) clone with PITR to = a specific point when you suspect the plan in question was used ("slow= ") -- and study the planner behavior in detail, experimenting and adju= sting planner parameters.

Nik
--00000000000002d9e5063a2a4317--