From: | "Carlos H(dot) Reimer" <carlos(dot)reimer(at)opendb(dot)com(dot)br> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | <pgsql-performance(at)postgresql(dot)org> |
Subject: | RES: Improving SQL performance |
Date: | 2007-01-11 21:14:51 |
Message-ID: | PEEPKDFEHHEMKBBFPOOKCEEADNAA.carlos.reimer@opendb.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Yes, I do have an index on tt_log.codcep.
Indexes I´ve on both tables:
tt_end
Indexes:
"pk_end" PRIMARY KEY, btree (filcli, codcli, codfil, numend)
"ak_end_numdoc" UNIQUE, btree (numdoc)
"i_fk_end_darc" btree (codarc, tiparc)
"i_fk_end_dend" btree (tipend)
"i_fk_end_dfil" btree (codfil)
"i_fk_end_dreg" btree (regiao)
"i_fk_end_mun" btree (codcid)
tt_log
Indexes:
"i_fk_log_bai" btree (codbai)
"i_lc_log_codcep" btree (codcep)
Any clue?
Thanks!
Reimer
> -----Mensagem original-----
> De: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Enviada em: quinta-feira, 11 de janeiro de 2007 16:31
> Para: carlos(dot)reimer(at)opendb(dot)com(dot)br
> Cc: pgsql-performance(at)postgresql(dot)org
> Assunto: Re: [PERFORM] Improving SQL performance
>
>
> "Carlos H. Reimer" <carlos(dot)reimer(at)opendb(dot)com(dot)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
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Jim C. Nasby | 2007-01-11 21:16:09 | Re: [HACKERS] unusual performance for vac following 8.2 upgrade |
Previous Message | Tom Lane | 2007-01-11 21:11:40 | Re: [HACKERS] unusual performance for vac following 8.2 upgrade |