From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Wolff III <bruno@wolff.to>
Cc: Danilo Mota <dmota@nexen.com.br>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query performance problem
Date: Fri, 20 Aug 2004 12:50:01 -0400
Message-ID: <27336.1093020601@sss.pgh.pa.us> (raw)
In-Reply-To: <20040820164821.GA26674@wolff.to>
References: <002201c486d2$4fbe4420$8afea8c0@nexen.lan>
<20040820164821.GA26674@wolff.to>
Bruno Wolff III <bruno@wolff.to> writes:
> I am going to assume that one of the sc.cpfcnpj's above is really rc.cpfcnpj
> since that corresponds to the explain below.
No, actually the explain plan corresponds to the sc.cpfcnpj = sc.cpfcnpj
condition. I didn't twig to the typo until I started to wonder why the
plan had the condition in the wrong place (attached to the seqscan and
not the join step).
> sc.cpfcnpj and rc.cpfcnpj are different length varchars. You made need
> an explicit cast to allow the use of indexes.
AFAIK the cross-type issues only apply to crossing actual types, not
lengths. That does look like an error in the database schema, though.
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruno@wolff.to, dmota@nexen.com.br
Subject: Re: Query performance problem
In-Reply-To: <27336.1093020601@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