Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id BDDFF9FB3CA for ; Fri, 12 Jan 2007 13:37:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 37673-08 for ; Fri, 12 Jan 2007 13:37:16 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from server.linux27.com (server.linux27.com [72.232.77.42]) by postgresql.org (Postfix) with ESMTP id B2B999FB351 for ; Fri, 12 Jan 2007 13:37:16 -0400 (AST) Received: from [201.67.130.242] (helo=PC1) by server.linux27.com with esmtpa (Exim 4.63) (envelope-from ) id 1H5QL1-0000XK-5q; Fri, 12 Jan 2007 15:37:11 -0200 Reply-To: From: "Carlos H. Reimer" To: "Tom Lane" Cc: Subject: RES: Improving SQL performance Date: Fri, 12 Jan 2007 15:37:13 -0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <28140.1168540267@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.linux27.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - opendb.com.br X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/207 X-Sequence-Number: 22808 Yes, casting the result improved the time response a lot. Thank you! Reimer > -----Mensagem original----- > De: pgsql-performance-owner@postgresql.org > [mailto:pgsql-performance-owner@postgresql.org]Em nome de Tom Lane > Enviada em: quinta-feira, 11 de janeiro de 2007 16:31 > Para: carlos.reimer@opendb.com.br > Cc: pgsql-performance@postgresql.org > Assunto: Re: [PERFORM] Improving SQL performance > > > "Carlos H. Reimer" 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org > >