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 1sP3xy-002hmo-SG for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jul 2024 17:40:26 +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 1sP3xw-00AxMD-Hh for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jul 2024 17:40:25 +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 1sP3xw-00AxM4-2a for pgsql-performance@lists.postgresql.org; Wed, 03 Jul 2024 17:40:24 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sP3xt-000EfM-Hi for pgsql-performance@lists.postgresql.org; Wed, 03 Jul 2024 17:40:22 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-585e774fd3dso4265328a12.0 for ; Wed, 03 Jul 2024 10:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1720028420; x=1720633220; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=qJwh3D/aHHj7yHl8wEFbJRG9rSXanST5K41ROSFjeZ8=; b=fhPBahr/vlRFsCzqvj4ON6pHL8yPQW8slPh0FVEiNetnM1Tw7UGRuhlvfw73c1WB/c QgDU/DqUyYVe19fJNVliBGKWfbALZMnIZfA25AP2M5LUI4eL/M7+EdER/uE/SnKFN8Iw ca5BT47JqkVX4szJ1QWKawnijw3S0LsLjJBAVLXZJc2oAwUeJxePEfK/wTEwkykgjx0z nasIwq42nV7ptduwEPtlK+SCbjbfsgcfSpgU0gEMEGO0oLQxFXjs+/rFre+WrCtbwfoQ sXKiMOW9qvB8dUEo7SQmR5knhcDC882NefBLH9mGHZ5+0aDanWLH+xlGkQNYLjhZdhRj Gr8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720028420; x=1720633220; h=content-transfer-encoding:in-reply-to: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=qJwh3D/aHHj7yHl8wEFbJRG9rSXanST5K41ROSFjeZ8=; b=vGzwZeyGq+ZqP1HccpHEDeop+upSUNV8FdbUKlARyuSdcrtFclkTWeliLpok2sxcWu I75e0SPUjx27FHFmKztWK1IRJM9QCBPvQwWz73ma6xxALSUHdsEUtaexV3uKQA6pAdW3 9WNi4yds43yTQtong0OSvGCY0IpHtQjtF2sRhg/AbVG3TShcCRG+++SamM//LZcxIuxA U5Q8OWbK9eRgy4+lFagdCk3WpuzSPoGxkpMr+PwgHwrsyogcfaSGXKrKK9OBW4cwFITO cn22Pu4ygZYlCQPuTpDh78Jn7YeTzdeQ+c2Osn+x141M6atu3CXHkH0NNsQor4ia+Mw0 v8Vg== X-Forwarded-Encrypted: i=1; AJvYcCU7tnum+P+zna/Zfo5DysrdM55f54E689Dy5ByCPMszcVyV5BSKhhCiXrVV1XupNgGcYtIW8fsspvIPVL2cNz8E3+CXJED+8s0QQbP1LCWCnjN2LlEYVw== X-Gm-Message-State: AOJu0YyniYqE9U/T8j1KyK/AV5WQZnR0cK7uPFGI4pVDmKkhWtULqpk3 /21n+4XBX34ekgK9usi6zjfFqcm+19mrCzAc+7ApgWbgvIV50fvI/kbP2UVpCA== X-Google-Smtp-Source: AGHT+IGbZ7CIfEZ3XEwgv8MsykvhnMKGLhb7DJZ6G7z/i+6ivgmPHVALqCeBOaec4QXNukfECtpwNw== X-Received: by 2002:a17:907:36c8:b0:a75:3f3c:f769 with SMTP id a640c23a62f3a-a753f3d05afmr372992866b.66.1720028419903; Wed, 03 Jul 2024 10:40:19 -0700 (PDT) Received: from [10.137.0.18] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab065147sm527505266b.120.2024.07.03.10.40.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jul 2024 10:40:19 -0700 (PDT) Message-ID: Date: Wed, 3 Jul 2024 19:40:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Hash Right join and seq scan To: James Pang , pgsql-performance@lists.postgresql.org References: Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi James, I think it'd be much easier to help you with investigating this issue if you shared the actual queries, and the full EXPLAIN ANALYZE output both with and without disabled hashjoin. Or even better, share a script that reproduces the issue (creates tables, loads data, runs the queries). BTW you suggested each partition has ~250k rows, but the explain plan snippet you shared does not seem to be consistent with that - it only shows 2500-5000 rows per partition. If you run ANALYZE on the table, does that change the plan? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company