Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7D61063F3A5 for ; Tue, 23 Feb 2010 12:53:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 82793-01 for ; Tue, 23 Feb 2010 16:53:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 6902D63F3CA for ; Tue, 23 Feb 2010 12:53:42 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 8986A348038; Tue, 23 Feb 2010 08:53:41 -0800 (PST) Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xra5zPuN69br; Tue, 23 Feb 2010 08:53:41 -0800 (PST) Received: from perhan.alvh.no-ip.org (200-85-218-3.bk4-dsl.surnet.cl [200.85.218.3]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 28EBE348036; Tue, 23 Feb 2010 08:53:41 -0800 (PST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 2B9A96E4A8; Tue, 23 Feb 2010 13:53:39 -0300 (CLST) Date: Tue, 23 Feb 2010 13:53:39 -0300 From: Alvaro Herrera To: negora Cc: pgsql-performance@postgresql.org Subject: Re: Internal operations when the planner makes a hash join. Message-ID: <20100223165339.GF3672@alvh.no-ip.org> References: <4B83E8C5.2050902@negora.com> <4B83A03E020000250002F4FD@gw.wicourts.gov> <4B8404CC.4060607@negora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B8404CC.4060607@negora.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/324 X-Sequence-Number: 37745 negora wrote: > According to how I understood the process, the engine would get the > name from the student with ID 1 and would look for the name of the > father with ID 1 in the hashed table. It'd do exactly the same with the > student #2 and father #2. But my big doubt is about the 3rd one > (Anthony). Would the engine "know" that it already had retrieved the > father's name for the student 1 and would avoid searching for it into > the hashed table (using some kind of internal mechanism which allows to > "re-utilize" the name)? Or would it search into the hashed table again?
The hash table is searched again. But that's fast, because it's a hash table. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.