Re: [PERFORM] Wrong index choice

2010-10-03 Thread Tom Lane
=?ISO-8859-1?Q?Fabr=EDcio_dos_Anjos_Silva?= writes: > explain analyze select max(cnpj) from empresa where dtcriacao >= > current_date-5; > QUERY > PLAN > -

Re: [PERFORM] Wrong index choice

2010-09-29 Thread Kevin Grittner
Fabrício dos Anjos Silva wrote: > explain analyze select max(cnpj) from empresa where dtcriacao >= > current_date-5; > Result (cost=32.24..32.24 rows=1 width=0) (actual > time=5223.937..5223.938 rows=1 loops=1) >InitPlan 1 (returns $0) > -> Limit (cost=0.00..32.24 rows=1 width=15)

[PERFORM] Wrong index choice

2010-09-29 Thread Fabrício dos Anjos Silva
Hi, I have this situation: Database size: 7,6GB (on repository) Memory size: 7,7GB 1 CPU: aprox. 2GHz Xeon Number of tables: 1 (empresa) CREATE TABLE "public"."empresa" ( "cdempresa" INTEGER NOT NULL, "razaosocial" VARCHAR(180), "cnpj" VARCHAR(14) NOT NULL, "ie" VARCHAR(13), "end