Skip site navigation (1) Skip section navigation (2)

Re: Query performance problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Danilo Mota <dmota(at)nexen(dot)com(dot)br>,pgsql-performance(at)postgresql(dot)org
Subject: Re: Query performance problem
Date: 2004-08-20 16:50:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Bruno Wolff III <bruno(at)wolff(dot)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

In response to

pgsql-performance by date

Next:From: Gaetano MendolaDate: 2004-08-20 19:43:24
Subject: Re: using an index worst performances
Previous:From: Bruno Wolff IIIDate: 2004-08-20 16:48:21
Subject: Re: Query performance problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group