Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU9eV-0008Nc-JO for pgsql-performance@arkaria.postgresql.org; Thu, 19 Jan 2017 10:09:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cU9eV-0001wU-1r for pgsql-performance@arkaria.postgresql.org; Thu, 19 Jan 2017 10:09:07 +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 1cU9eU-0001wL-0v for pgsql-performance@postgresql.org; Thu, 19 Jan 2017 10:09:06 +0000 Received: from mail-vk0-x22e.google.com ([2607:f8b0:400c:c05::22e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cU9eQ-0007RB-E9 for pgsql-performance@postgresql.org; Thu, 19 Jan 2017 10:09:04 +0000 Received: by mail-vk0-x22e.google.com with SMTP id r136so26199506vke.1 for ; Thu, 19 Jan 2017 02:09:02 -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=Mkt6lAA7YEIRlKT5tbVjVZ7SgHVWpN7Kr7tNh0C6w9U=; b=JRxhxgPRqAH4cnqRJw55k48Ot84x++cQVKVLlNImQRFuEN/9SqXwgh/BSYLTFPq4bl prwZZJxqx13U3iBaZoafF+OkTaL8peyvitC8jCPZEmqV+3Nttk3mHkS7OA7PifFzg0Mf dSlsrlS+YOc3rTtxqp5si2s4bmbG9lbj63neimInSTavqQLlAOONl/4wIwsExAbRX5Yg +6huet+ZrghMm10MTdFhcd+jstLp8kVglmLDKLgt0QilN3seuBnZKVElL0QMeUceXffV pwQmlSqiS+/PLg1ENhm9PjYXxIR1LjVYN2CG7AOhewuzdFbAf/hDNFYHbPL07s/zcMz5 1Kaw== 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=Mkt6lAA7YEIRlKT5tbVjVZ7SgHVWpN7Kr7tNh0C6w9U=; b=ZOCwhOfDXFSZQGL2xgD+chKgI83DH4fd3PJkjm66R/mN85cu+0KhSOtRy4npLoNd4Q B+DRLXCYgqO40+bjQYExo+K+fJchupAnFGZ6epvDq0RfCDi1xrl92+HDhDlr3m/+KIvx ooBvC8zfcvHfRBPB3/FVMsyvLXYOhDeprsjFZq63PWL1hrAiPZNLxmA8XNDzkP4CkYx0 9pwUvMLnK8EptBtTYgGX2ft7u8nTpzKhYVF/iiYvkLOWJ8R1EcA7kSbbrz0GR1+ONgRe UrFNNuhDbZYdIl3J+/L8AfbBpSR1ZTFl3qsUWdPd18OmbmDi+iaiW8hs5ywoCJxg3yN9 M7sg== X-Gm-Message-State: AIkVDXIhEjR/NTQZO/SN7BIj9/Urw3kckTwL8uW/kswGYTGSAfhH6wpmeZWx7+kDV96ECA== X-Received: by 10.31.73.198 with SMTP id w189mr3266857vka.170.1484820540398; Thu, 19 Jan 2017 02:09:00 -0800 (PST) Received: from [192.168.0.9] ([191.190.196.248]) by smtp.gmail.com with ESMTPSA id d63sm1209033vkh.4.2017.01.19.02.08.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2017 02:08:59 -0800 (PST) To: "pgsql-performance@postgresql.org" From: Clailson Subject: Optimization inner join Message-ID: <7ad1128e-7fdb-9976-823c-d4abdf554fa2@gmail.com> Date: Thu, 19 Jan 2017 07:08:47 -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="------------585BE5F813EA4ABDCFAF54F2" X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org This is a multi-part message in MIME format. --------------585BE5F813EA4ABDCFAF54F2 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 --------------585BE5F813EA4ABDCFAF54F2 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
--------------585BE5F813EA4ABDCFAF54F2--