Re: Improving SQL performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: Improving SQL performance
Date
Msg-id 28140.1168540267@sss.pgh.pa.us
Whole thread Raw
In response to Improving SQL performance  ("Carlos H. Reimer" <carlos.reimer@opendb.com.br>)
Responses RES: Improving SQL performance  ("Carlos H. Reimer" <carlos.reimer@opendb.com.br>)
RES: Improving SQL performance  ("Carlos H. Reimer" <carlos.reimer@opendb.com.br>)
List pgsql-performance
"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

pgsql-performance by date:

Previous
From: Russell Smith
Date:
Subject: Re: Improving SQL performance
Next
From: Kim
Date:
Subject: Re: unusual performance for vac following 8.2 upgrade