pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Clailson <clailson.dba@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Optimization inner join
Date: Wed, 18 Jan 2017 16:56:49 -0300
Message-ID: <e9a18035-bad1-1338-7447-41c678cf0800@gmail.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

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

Message-ID: <e9a18035-bad1-1338-7447-41c678cf0800@gmail.com>
Permalink:  ../e9a18035-bad1-1338-7447-41c678cf0800@gmail.com/
Also on:    postgresql.org/message-id/e9a18035-bad1-1338-7447-41c678cf0800@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: clailson.dba@gmail.com
  Subject: Re: Optimization inner join
  In-Reply-To: <e9a18035-bad1-1338-7447-41c678cf0800@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox