pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: carlos.reimer@opendb.com.br
Cc: pgsql-performance@postgresql.org
Subject: Re: Improving SQL performance
Date: Thu, 11 Jan 2007 13:31:07 -0500
Message-ID: <28140.1168540267@sss.pgh.pa.us> (raw)
In-Reply-To: <PEEPKDFEHHEMKBBFPOOKAEDKDNAA.carlos.reimer@opendb.com.br>
References: <PEEPKDFEHHEMKBBFPOOKAEDKDNAA.carlos.reimer@opendb.com.br>

"Carlos H. Reimer" <carlos.reimer@opendb.com.br> writes:
> I know that the problem with the following SQL is the "LOG.CODCEP =
> ENDE.CODCEP||CODLOG" condition, but what can I
> do to improve the performance?

Seems the problem is not using an index for tt_log.  Do you have an
index on tt_log.codcep?  If so, maybe you need to cast the result of
the concatenation to char(8) to get it to use the index.

			regards, tom lane



view thread (3+ messages)

Message-ID: <28140.1168540267@sss.pgh.pa.us>
Permalink:  ../28140.1168540267@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28140.1168540267@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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, carlos.reimer@opendb.com.br
  Subject: Re: Improving SQL performance
  In-Reply-To: <28140.1168540267@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