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 1rG1NF-00DHDl-EF for pgsql-performance@arkaria.postgresql.org; Wed, 20 Dec 2023 18:32:53 +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 1rG1ND-00Fhiq-Qj for pgsql-performance@arkaria.postgresql.org; Wed, 20 Dec 2023 18:32:51 +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 1rG1ND-00Fhih-Fr for pgsql-performance@lists.postgresql.org; Wed, 20 Dec 2023 18:32:51 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rG1NB-00D1Rq-1r for pgsql-performance@lists.postgresql.org; Wed, 20 Dec 2023 18:32:50 +0000 Received: from [192.168.1.20] (lfbn-ren-1-1137-121.w92-139.abo.wanadoo.fr [92.139.85.121]) by mail.dalibo.com (Postfix) with ESMTPSA id E83141F821; Wed, 20 Dec 2023 19:32:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1703097168; bh=bO1m7lkW8yvCkdUgDDfOf5BG5MnebUVRI7p/rP0u80Q=; h=Date:Subject:To:References:From:In-Reply-To:From; b=NxC8XCi4sIlvFXIOGbg40ww2E99uSJ7dpxvuYYEW6h6L0NC3cvcSbdERKsJQlpwHo B6QN1k0OF7DdkTUivHRTlGgeO1Wa+AS2ybhqxsUvEAHCnFdkO52sET7kLyP8+E028y qiFYkssyLaStWMpWBc3AX2OT+rKh4LOpWnUaCJq0= Message-ID: Date: Wed, 20 Dec 2023 19:32:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Which side of a Merge Join gets executed first? Do both sides always get executed? Content-Language: fr, en-US To: Jerry Brenner , pgsql-performance@lists.postgresql.org References: From: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Yhuel?= Autocrypt: addr=frederic.yhuel@dalibo.com; keydata= xjMEXn3bgxYJKwYBBAHaRw8BAQdA6tX5FT/n5ztMWIoBdl6k5avvu65fv6ryfVzIx/aH3V3N JEYuIFlodWVsIDxmcmVkZXJpYy55aHVlbEBkYWxpYm8uY29tPsKWBBMWCAA+FiEEi7OTyf6H ePS+C6n11XGWhN8zGNUFAl6G6CYCGwMFCQeE3WIFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA CgkQ1XGWhN8zGNWH2wEA/YqoX3f4vTCknwEQgJtqWmcahkMKeusqdddqAB/jclQBAIKj3+N8 fj3S9ZASdfUUz+PoPBvuDSSTdOqwfjX9hZkNzjgEXn3bgxIKKwYBBAGXVQEFAQEHQCuh5cLQ AtEBXHa2Fmtp0kduBu7msM7qO/gaEcdjFUdiAwEIB8J+BBgWCAAmAhsMFiEEi7OTyf6HePS+ C6n11XGWhN8zGNUFAl596uUFCQeE3WIACgkQ1XGWhN8zGNVjGgEA8sKopTosiMWP+pbyf4jF 5WphrhyQf+EBlKIAs0eOpOABAMFDjT7cnlc72KVZd79jT3zmEoVq+IUW5QhcW03LnhoN In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Le 20/12/2023 à 15:40, Jerry Brenner a écrit : > Whichever side gets executed first, is the execution of the side that > would be second get short circuited if 0 rows are returned by the first > side? Indeed, if 0 rows are returned from the outer relation, the scan of the inner relation is never executed. Best regards, Frédéric