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 1vTWo3-003rzk-1N for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 02:53:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vTWo1-0020AZ-0H for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 02:53:25 +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 1vTWo0-0020AP-2Y for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 02:53:25 +0000 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vTWny-0005Pt-2q for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 02:53:25 +0000 Received: by mail-qv1-xf42.google.com with SMTP id 6a1803df08f44-88246676008so6011666d6.3 for ; Wed, 10 Dec 2025 18:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765421600; x=1766026400; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=C/SieE3QT0SIf+542itYzQjaXdL3ryxgVNUKP3f2VCw=; b=LQOAO0j3lctRiNj8DsgpMkojs8Fgxtnev8YCJM9bxY05ol1ro5TjOHMPpgGFJWSEha SiDLYqzagK3+MmSnpTQ9dHNh98aLJOGttRHA8Cs2kpfP3sQS/j2JNuSEv9Yuae/0M78D /f5zNpjktL3Hz8Q70QJGdFzosAH6GQdJjkP/VyT+dueceb5U+OxEnuUxh9a4mdIWF0w5 fNMTboo2J4RPJ5zLvyK21D632adG/Qz144MF1F4GyRKQ/l2mVLD4BawFQT+yoohYXX45 GkW3f+a4FCxFos6mVl0u32O/Kjkx+rdnjtQxgbeAiXFkELSvXh7sg0xwhwu+A3HeTVvV xr7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765421600; x=1766026400; h=content-transfer-encoding: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=C/SieE3QT0SIf+542itYzQjaXdL3ryxgVNUKP3f2VCw=; b=ga+dLgf7gZOMbA/ttcadR7oPttISHG4aJxrZmH0wenCD++pgV4E3uF+anLxR17cwdL cmXPfT1+SQpfg7Y5aZhv3htBIT7ZBZsxYrDTONZB3ZIll70PuOhCxXJQ8aMAWU+IizAO F83kKOxbgtZrfzQ/y1tFgfmjrCiJPrivETMGnXRsNZ9y8ddybMy5S2rbLCBJTxU8GvUR JrCJETTLuBrLpHDjahipAQCUk+MnEvimORNZi+RppP/yGXuEWEuF0onC72XjAUGV9yjb ignr8QSJz4dIgNmhNdAy/7wypYB6ktNlxWhZcJ3u9zMbUgb4JBV1fdnO5o+dVmRRI7LF fHpg== X-Forwarded-Encrypted: i=1; AJvYcCVr8/Q/W6fM4uaS4h5aCybwjwvlukpcfhEH0iEoJknTkaSuQNYxmaFJ9LmSQzBInXu83cnPMrcurholEDYk@lists.postgresql.org X-Gm-Message-State: AOJu0Ywst1i7iI1VTkI0mngybsEl6Pf4uQmjFmpXB7zZ5R9oy0Bdj+1N DN1wg89VAZTrALc0zW9ZuiIvZUf2IYe4+5nYXbp63oMqeU+TURf7cvXRP6DA10is2AhJ67P+1o0 iPjltv/DSGt28pnWPWuFWHPJVz/qhkJI= X-Gm-Gg: AY/fxX75Am+IhWWIVVVj2HyUcg/jAMk12c6WB5XkffdYZiJLiseWuNSVsIsXRcfqGoh 7zj2sIOZ+ezv7R723l2tazcGbmQvx1caCh2c2QRhF+Q9wHsn2+xAXvPk+dDqgb6Uu6ZJDX+aGTO RBRcFBM3OdBV/YEP5Y9GIfNMnHMsf4YHvYH3xlRfo8d2iGLRXdgvtjmostTDINw5MwtJ6Lr+M39 w5Zw8Oh/P4CjQz6P81R8olzx6RypHaeHQ0+MK//SYxiqvYzGiW9ULv6MdW4kBbFGdiHkwLA0u2a qnuKpAJQvT6iWEXO4WHyGaQY2CQcxkl22CqmPGqW3RyNsMG3NMiLR7sJm3eKk8qe0u+m0+ioKJF vOrjWBNNQ3ivLMeQ= X-Google-Smtp-Source: AGHT+IFbc2I49RulacZin417yPt317gu3BpYtWen0Oo46AIkn3xPbiSPge223HArbPUnqPaVtaF/Kl0IOFuVCjDtrxw= X-Received: by 2002:ac8:5705:0:b0:4ed:20bc:dc0b with SMTP id d75a77b69052e-4f1b1a93d5amr62699631cf.35.1765421600321; Wed, 10 Dec 2025 18:53:20 -0800 (PST) MIME-Version: 1.0 References: <3FF63E99-AB4F-41A9-BC78-AAB28823FBD0@Outlook.com> <6db6d2ec-7529-4add-9a95-178fc318311d@vondra.me> <313ACE5A-CBF1-43B3-9181-10D3E8ADF424@Outlook.com> <5abd6054-413c-4f48-9172-d8b31062b266@vondra.me> <938E2286-9B0D-4F8D-A916-8E0E35D55034@Outlook.com> In-Reply-To: From: John Naylor Date: Thu, 11 Dec 2025 09:53:09 +0700 X-Gm-Features: AQt7F2rklXM5kcqYpRB0ycJgQ8AEdz0ZqyS7Ee36QO1tCYtHKAO5YMDy14BGTnw Message-ID: Subject: Re: Add a greedy join search algorithm to handle large join problems To: Tomas Vondra Cc: Chengpeng Yan , "pgsql-hackers@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Dec 10, 2025 at 5:20=E2=80=AFPM Tomas Vondra wrot= e: > I did however notice an interesting thing - running EXPLAIN on the 99 > queries (for 3 scales and 0/4 workers, so 6x 99) took this much time: > > master: 8s > master/geqo: 20s > master/goo: 5s > It's nice that "goo" seems to be faster than "geqo" - assuming the plans > are comparable or better. But it surprised me switching to geqo makes it > slower than master. That goes against my intuition that geqo is meant to > be cheaper/faster join order planning. But maybe I'm missing something. Yeah, that was surprising. It seems that geqo has a large overhead, so it takes a larger join problem for the asymptotic behavior to win over exhaustive search. -- John Naylor Amazon Web Services