Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU0j7-0002Zt-I2 for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Jan 2017 00:37:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cU0j7-0000hi-0i for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Jan 2017 00:37:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cU0iR-0007fA-9U for pgsql-bugs@postgresql.org; Thu, 19 Jan 2017 00:36:35 +0000 Received: from mail-ua0-x22f.google.com ([2607:f8b0:400c:c08::22f]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cU0iO-0004Gz-C6 for pgsql-bugs@postgresql.org; Thu, 19 Jan 2017 00:36:33 +0000 Received: by mail-ua0-x22f.google.com with SMTP id y9so22533510uae.2 for ; Wed, 18 Jan 2017 16:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version; bh=6cvzRkxinDh+u/naOHo7y3wj2noJfo0MTAO8MKu8RnU=; b=vPhU0XQvYz5Mn9cZW5bOlpJ5Nxx8pNH5pBpOdzL+P4yrdJqy7pEfnWJ+rD8ktn4c4k +KSkmK05+U93aLAHhzjtA2TwGIeaNJcOgGTzaisgL2889SA50IWdj5BFn/0ADVr84PeA dbtn09Tvbg/oJzF8QsgAnTAFyMMXw152aXEi4UAHuakzr8FBHr20mNdizQXIiJnR8wJK /92dUdM//4uQuC6uMYW3dJoqR+aHwVLnh0tlG4DcdYk77zYiViDwjDQLAqWa69D/ahP7 4mHbuwNPV0IH0PqHnhn3DHOktBHwi5Hr4NUP3f2ybzErcTVjhtOIVctuowZldk91WOfD zOJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=6cvzRkxinDh+u/naOHo7y3wj2noJfo0MTAO8MKu8RnU=; b=PK2x3dkUlY2+/Wds3YpjzGlDTFirV/II5eLj5yZqrYr45glo3iFV2N+suYOd9iE0kc nf2LrcRlzWqAAvrbpnVjl7ZPz7Pq2Y8AT6dXB/DFHDC6BHSw0PS1xCb3WvlNmht6Eoca xfUd4YtwcNUVIkdhDg+DgS1LP8Qi/a4ZJO0P5bMJ6AevhrUK8gZGhgFoGLkwdlu7mGC8 JFkswEfLEM2D6JsfG0YMFpNDpvulVbbntu2x/T63povyLsO+NBZitTOiroElmrYk7m7r Zu5+KjEfuhL0UrCyxLMihI52Tbb0mA9NaQMEmogmrRSlpbusJJvf2llVNJriEpFNo63q t88g== X-Gm-Message-State: AIkVDXKzHENljHc6I3eWuzRJnuU54cqAYXz/+nfQFEsIFnHrh7fwrlDj74trewSRjhTl9A== X-Received: by 10.176.90.208 with SMTP id x16mr3388533uae.158.1484786191393; Wed, 18 Jan 2017 16:36:31 -0800 (PST) Received: from [192.168.0.9] ([191.190.196.248]) by smtp.gmail.com with ESMTPSA id u78sm780157uau.13.2017.01.18.16.36.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 16:36:30 -0800 (PST) To: pgsql-bugs@postgresql.org From: Clailson Subject: Optimization inner join Message-ID: Date: Wed, 18 Jan 2017 21:36:21 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------655EEF86BD1AB5A368319946" X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------655EEF86BD1AB5A368319946 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Hi, Is there something in the roadmap to optimize the inner join? I've this situation above. Table b has 400 rows with null in the column b. explain analyze select * from a inner join b on (b.b = a.a); "Merge Join (cost=0.55..65.30 rows=599 width=16) (actual time=0.030..1.173 rows=599 loops=1)" " Merge Cond: (a.a = b.b)" " -> Index Scan using a_pkey on a (cost=0.28..35.27 rows=1000 width=8) (actual time=0.014..0.364 rows=1000 loops=1)" " -> Index Scan using in01 on b (cost=0.28..33.27 rows=1000 width=8) (actual time=0.012..0.249 rows=600 loops=1)" "Total runtime: 1.248 ms" My question is: Why the planner isn't removing the null rows during the scan of table b? -- Clailson Soares Dinízio de Almeida --------------655EEF86BD1AB5A368319946 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit Hi,

Is there something in the roadmap to optimize the inner join?

I've this situation
above. Table b has 400 rows with null in the column b.

explain analyze select * from a inner join b on (b.b = a.a);
"Merge Join  (cost=0.55..65.30 rows=599 width=16) (actual time=0.030..1.173 rows=599 loops=1)" 
"  Merge Cond: (a.a = b.b)" 
"  ->  Index Scan using a_pkey on a  (cost=0.28..35.27 rows=1000 width=8) (actual time=0.014..0.364 rows=1000 loops=1)" 
"  ->  Index Scan using in01 on b  (cost=0.28..33.27 rows=1000 width=8) (actual time=0.012..0.249 rows=600 loops=1)" 
"Total runtime: 1.248 ms" 

My question is: Why the planner isn't removing the null rows during the scan of table b?
-- 
Clailson Soares Dinízio de Almeida
--------------655EEF86BD1AB5A368319946--