pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: William Leite Araújo <william.bh@gmail.com>
Cc: José Carlos <jc4520@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Postgresql quey planner
Date: Thu, 05 Oct 2006 15:20:59 -0400
Message-ID: <262.1160076059@sss.pgh.pa.us> (raw)
In-Reply-To: <bc63ad820610051202n45dd8adcua57d7228e53218da@mail.gmail.com>
References: <bc63ad820610051202n45dd8adcua57d7228e53218da@mail.gmail.com>

"=?ISO-8859-1?Q?William_Leite_Ara=FAjo?=" <william.bh@gmail.com> writes:
>      The second does really what I desire. Show all records in table
> "posto", including that's without count in table "autuados". But the first,
> doesn't. Some elements on table "Posto" are ommited.

What PG version is this?  8.1.0 through 8.1.3 had a logic bug in merge
right joins, which perhaps is your problem, although the commit message
only mentions duplicate rows not missing ones.

2006-03-17 14:38  tgl

	* src/: backend/executor/nodeMergejoin.c,
	test/regress/expected/join.out, test/regress/expected/join_1.out,
	test/regress/sql/join.sql (REL8_1_STABLE): Fix bug introduced into
	mergejoin logic by performance improvement patch of 2005-05-13. 
	When we find that a new inner tuple can't possibly match any outer
	tuple (because it contains a NULL), we can't immediately skip the
	tuple when we are in NEXTINNER state.  Doing so can lead to
	emitting multiple copies of the tuple in FillInner mode, because we
	may rescan the tuple after returning to a previous marked tuple. 
	Instead, proceed to NEXTOUTER state the same as we used to do. 
	After we've found that there's no need to return to the marked
	position, we can go to SKIPINNER_ADVANCE state instead of SKIP_TEST
	when the inner tuple is unmatchable; this preserves the performance
	improvement.  Per bug report from Bruce.  I also made a couple of
	cosmetic code rearrangements and added a regression test for the
	problem.

			regards, tom lane



view thread (2+ messages)

Message-ID: <262.1160076059@sss.pgh.pa.us>
Permalink:  ../262.1160076059@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/262.1160076059@sss.pgh.pa.us

 · 

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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, william.bh@gmail.com, jc4520@gmail.com
  Subject: Re: Postgresql quey planner
  In-Reply-To: <262.1160076059@sss.pgh.pa.us>

* 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