Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pD0P2-00032c-R9 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jan 2023 09:49:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pD0P1-0007Rm-Ln for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jan 2023 09:49:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pD0P1-0007Rd-AL for pgsql-hackers@lists.postgresql.org; Wed, 04 Jan 2023 09:49:43 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pD0Ov-0006nD-Dl for pgsql-hackers@postgresql.org; Wed, 04 Jan 2023 09:49:42 +0000 Received: by mail-oi1-x22e.google.com with SMTP id s187so29073273oie.10 for ; Wed, 04 Jan 2023 01:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+UX48c2IWzZhsRYHqgAHZm+d+RGwrEWIteMcpi9sysA=; b=NUF+RRiH3FUMRu9TRsP0kXA8HLunKNGdi8YY2Rv1hQiNg24vJlowSDuARGAfU+T1UO KXQU1iADVeTFGT1pchSpC5UgOb6LYfH6xlEs/4WJtHt8Wqv7LqADc0Dk/8R5qvRpUcPq EFsrTJP5nu4aqGRUx2tEJZLPYsLnnLHkAckXeI8unnj1rMusGIM7n60dXJ3MVpdXsEiR PHXi5Ws7ellrpz6js/FZOKw35pIYE7eke4yo5G4rTWjmRYYxBQ1D7GGY6b8K+MU6ThXR 2DB9PNpH/IVz8kdW2rnojZtyOZIr/LxBqhAx3OOSBseRke5uUrpeiCK3GTBxZFZTyZEj fiVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=+UX48c2IWzZhsRYHqgAHZm+d+RGwrEWIteMcpi9sysA=; b=RD5wd0XE9fu2dN3bOBCL2AnN5rByyplGd/ieltlsCrjBV5A5gnl/BUGPWZS84QGyNz CFYLVrOQ8k959WZw71idK/Jjfl9Q7qDGCYbsDMIxRdjcwqevQ2TJUcwGFdYWhxSu1yg8 G427lSM3BqMaBRSNSGHsfrG1VgaIVYyFXg6oQNXdo1PERUrPhrxsWm3nJgjwtwFp0kHV 0JpgkGRMlygjYvkjR5tkVvwea4hT6DqA870aX7NUgL8KNWy6enNGuOTbLcxEKS+Y522z zrChKy2BjsRlLaEsiNacZsGBoDuDgBNpc7xw5+s0gaI48kD8iMe9iu3jZw/C/qXTbsRL 1ugg== X-Gm-Message-State: AFqh2kolLYP0foeRFYphsxu6Rf84CF4r5G6q9YWo0JzCDe4XfWH5+RBF YAVg6/b9MMkEXMD/C43Iz3QhGyqG4GAUu23ZVWjlmUIVEshIFQCU X-Google-Smtp-Source: AMrXdXuY+GMuqzViXVtNat2wS2PVHcoTudmfXyQECXiJAo1+prw99MT+8F5D6UJFrhUSWZPKsuWX56MWVsQquhXM9r4= X-Received: by 2002:a05:6808:10d6:b0:354:99ec:a266 with SMTP id s22-20020a05680810d600b0035499eca266mr2614377ois.38.1672825775362; Wed, 04 Jan 2023 01:49:35 -0800 (PST) MIME-Version: 1.0 References: <20220322004805.vwmgjp62tq3mj2oq@alap3.anarazel.de> In-Reply-To: From: vignesh C Date: Wed, 4 Jan 2023 15:19:24 +0530 Message-ID: Subject: Re: Parallelize correlated subqueries that execute within each worker To: James Coleman Cc: Andres Freund , Robert Haas , pgsql-hackers , Amit Kapila , Tom Lane Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 27 Sept 2022 at 08:26, James Coleman wrote: > > On Mon, Mar 21, 2022 at 8:48 PM Andres Freund wrote: > > > > Hi, > > > > On 2022-01-22 20:25:19 -0500, James Coleman wrote: > > > On the other hand this is a dramatically simpler patch series. > > > Assuming the approach is sound, it should much easier to maintain than > > > the previous version. > > > > > > The final patch in the series is a set of additional checks I could > > > imagine to try to be more explicit, but at least in the current test > > > suite there isn't anything at all they affect. > > > > > > Does this look at least somewhat more like what you'd envisionsed > > > (granting the need to squint hard given the relids checks instead of > > > directly checking params)? > > > > This fails on freebsd (so likely a timing issue): https://cirrus-ci.com/task/4758411492458496?logs=test_world#L2225 > > > > Marked as waiting on author. > > I've finally gotten around to checking this out, and the issue was an > "explain analyze" test that had actual loops different on FreeBSD. > There doesn't seem to be a way to disable loop output, but instead of > processing the explain output with e.g. a function (as we do some > other places) to remove the offending and unnecessary output I've just > removed the "analyze" (as I don't believe it was actually necessary). > > Attached is an updated patch series. In this version I've removed the > "parallelize some subqueries with limit" patch since discussion is > proceeding in the spun off thread. The first patch adds additional > tests so that you can see how those new tests change with the code > changes in the 2nd patch in the series. As before the final patch in > the series includes changes where we may also want to verify > correctness but don't have a test demonstrating the need. The patch does not apply on top of HEAD as in [1], please post a rebased patch: === Applying patches on top of PostgreSQL commit ID bf03cfd162176d543da79f9398131abc251ddbb9 === === applying patch ./v5-0002-Parallelize-correlated-subqueries.patch patching file src/backend/optimizer/path/allpaths.c ... Hunk #5 FAILED at 3225. Hunk #6 FAILED at 3259. Hunk #7 succeeded at 3432 (offset -6 lines). 2 out of 7 hunks FAILED -- saving rejects to file src/backend/optimizer/path/allpaths.c.rej [1] - http://cfbot.cputube.org/patch_41_3246.log Regards, Vignesh