From: Tom Lane <tgl@sss.pgh.pa.us>
To: mjnf@uevora.pt
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Wierd stuff
Date: Mon, 06 Dec 1999 10:14:02 -0500
Message-ID: <18398.944493242@sss.pgh.pa.us> (raw)
In-Reply-To: <384BBEF2.B6CB6CDD@neptuno.uevora.pt>
Mario Jorge Nunes Filipe <mjnf@neptuno.sc.uevora.pt> writes:
> Tom Lane wrote:
>> Actually, I think that this may indeed be the root of the problem.
>> I killed several bugs in cross-data-type joins a while back ... for
>> example, IIRC pre-6.5 Postgres thought it could use hash joins for
>> cross-data-type equality operators, but that doesn't work properly in
>> general. Mario, what does EXPLAIN show about how the join query is
>> being done?
> To awnser your question... EXPLAIN shows this:
> sac=> explain select c.nome from aluno a, concelho c where
> sac-> a.concelho_naturalidade=c.codigo and a.numero_aluno=13792;
> NOTICE: QUERY PLAN:
> Hash Join (cost=27.44 size=164 width=18)
> -> Seq Scan on c (cost=13.16 size=308 width=16)
> -> Hash (cost=0.00 size=0 width=0)
> -> Index Scan on a (cost=2.05 size=2 width=2)
Yup, that's what I suspected. Hashing 2-byte and 4-byte integers
doesn't deliver the same result --- at least not all the time, there
are special cases such as zero. So this explains all your observed
misbehaviors.
You can work around it for now by remaking the tables with consistent
data types.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, mjnf@uevora.pt
Subject: Re: [SQL] Wierd stuff
In-Reply-To: <18398.944493242@sss.pgh.pa.us>
References: <384BBEF2.B6CB6CDD@neptuno.uevora.pt> <18398.944493242@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