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 1szRK0-0061Q9-GZ for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Oct 2024 01:53:32 +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 1szRJw-00Fwc0-Ob for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Oct 2024 01:53:29 +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 1szRJw-00Fwbq-Bq for pgsql-bugs@lists.postgresql.org; Sat, 12 Oct 2024 01:53:28 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1szRJu-000S34-7u for pgsql-bugs@lists.postgresql.org; Sat, 12 Oct 2024 01:53:27 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-71df2b0a2f7so2298096b3a.3 for ; Fri, 11 Oct 2024 18:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728698005; x=1729302805; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:cc:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=Ohy9H632RHZaH63nWZkKiMMPX14BDRGR3Q4A2v6v+Ig=; b=WHlpnHd6oQSrzX4wwgOt/O6bri1L6d6qToMuXlFQZHp2b9FhwldeueZNqpBnSV9xhM Lq0ZqOgjL0DIUJD0UPALPnyd4/Ozf05tkfew3rrMRH1PRT70QReTP5WYM5mX0jZyfBsK oMR8dLyOl6TBGknFftJY1vkIKb94zQWtFsDSqyplZV+4Hdeq4NxoWxCoK1wYMxNgdprT nMw/68DEGgfmbxElbU0Rr6rZIvw6traUpj/Qv7Z5tGA1a3Fl27CB0LPnkinaCBsepgrp Y5yRYzisqhOM9xLwKPKxW8PdNZxTM2XgfOhmBSnl3lDuvjkTuss17MKimXWK1FgaVv70 xezw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728698005; x=1729302805; h=content-transfer-encoding:in-reply-to:cc:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ohy9H632RHZaH63nWZkKiMMPX14BDRGR3Q4A2v6v+Ig=; b=tyv8FS8F63itIJAvbIiEx+JVAJJcR8eKE7oIOBFwapAFZnL8IKolBJBSwsYw+6b/kg AftwZFjtY5bYQuMHb4GKlEt4w9mjepCmtnF8Fm4WVxugcRRYIiHHNMfPgXrr9TgcPUHG HCZ7dwpr1A0QEsuYveiaGv5+QR2bSqe0rxqQZod7NbBdmXMtO0QUA4jHSZ7ZNOqK6mD6 1x8NoBgZSPcWyA2tSviZLnMW0ZcZ7vIfsmRPdvJRVYBFyqqiQrSAQsFP6huCRhKhr8eW +Vfgp3Op70CwKuypSqWKPaaluobphqcGRyoLlbgLpNawySV+ctFXYoRVKzfKYmwphs1e UHww== X-Forwarded-Encrypted: i=1; AJvYcCUzqD3zJe80NBxvDRG8xGQ/9IkcKt8O4ol1dtAROq5+ywBK5SS64M3RDtDUt35vnuruhmUObSSMASz2@lists.postgresql.org X-Gm-Message-State: AOJu0YwmyRXFox3SLvvbIXaOKvEX+ejy6q66xhMKJxOdAMUYHh92NNg/ qmpD5CRX9RanfiztEzkEnyUpZIbEGL/2uhKKCt7Fg/ZqBkApedw8 X-Google-Smtp-Source: AGHT+IEY6McmikMhm766bFgDZnng6yDU5kzWJJID8EtsC0GHKanLR8LphkcvZIpzOV517VeT1qxdRQ== X-Received: by 2002:a05:6a00:2da5:b0:71e:cb5:220a with SMTP id d2e1a72fcca58-71e37e4ce47mr6614418b3a.10.1728698005100; Fri, 11 Oct 2024 18:53:25 -0700 (PDT) Received: from [192.168.1.102] ([103.206.205.199]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea49e083d6sm2471831a12.41.2024.10.11.18.53.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Oct 2024 18:53:24 -0700 (PDT) Message-ID: <978176f8-14a5-4f4d-8925-07d2e7dec4ce@gmail.com> Date: Sat, 12 Oct 2024 08:53:19 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Question of Parallel Hash Join on TPC-H Benchmark To: Ba Jinsheng References: <20f9671d-6f40-429b-a749-a2f53086e0dd@vondra.me> <3c7df680-97e6-4f20-ab27-65fb8282f95e@Spark> Content-Language: en-US From: Andrei Lepikhov Cc: Tomas Vondra , Zhang Mingli , "pgsql-bugs@lists.postgresql.org" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/10/2024 23:52, Ba Jinsheng wrote: > Thanks for your replies! > > > I configured these variables and did get a worse query plan: Could you provide SQL dump and settings to play with this case locally? I would discover what we need to transform Subplan 1 into a SEMI JOIN. Also, I usually force parallel workers with settings like below: max_parallel_workers_per_gather = 32 min_parallel_table_scan_size = 0 min_parallel_index_scan_size = 0 max_worker_processes = 64 parallel_setup_cost = 0.001 parallel_tuple_cost = 0.0001 just to be sure, it's not the case when something down the plan tree forbids generating a parallel query plan. P.S. To discover other options, the AQO extension may be helpful. It stores cardinalities from all plan nodes after execution and uses them to calculate selectivities on the subsequent execution. -- regards, Andrei Lepikhov