I'm new in PostGreSQL and I need some help. I have a table with ~2 million records. Queries in this table are too slow and some are not completed. I think it must be a simple question to solve but, I'm trying without success. I'm worried because next week I will need to work with tables with ~100 million records. I'm using: O.S.: Windows XP; PostgreSQL 8.2; Index type: btree. I have 2 GB of RAM. POSTGRESQL XXX.LOG:
<2007-10-05 09:01:42%SELECT> LOG: could
not send data to client: Unknown winsock error 10061
<2007-10-05 09:03:03%idle> LOG: could
not receive data from client: Unknown winsock error 10061
<2007-10-05 09:03:03%idle> LOG:
unexpected EOF on client connection
PSQLODBC.LOG:
[13236.470]
------------------------------------------------------------ a_teste_nestle."CODCLI", a_teste_nestle."CODFAB", a_teste_nestle."CODFAMILIANESTLE", a_teste_nestle."CODFILIAL", a_teste_nestle."CODGRUPONESTLE", a_teste_nestle."CODSUBGRUPONESTLE", a_teste_nestle."CONDVENDA", a_teste_nestle."DATA", a_teste_nestle."DESCRICAO", a_teste_nestle."PESO", a_teste_nestle."PRACA", a_teste_nestle."PUNIT", a_teste_nestle."PVENDA", a_teste_nestle."QT", a_teste_nestle."QTITVENDIDOS", a_teste_nestle."QTPESOPREV", a_teste_nestle."QTVENDAPREV", a_teste_nestle."SUPERVISOR", a_teste_nestle."VENDEDOR", a_teste_nestle."VLVENDAPREV" from a_teste_nestle '
POSTGRESQL.CONF:
#--------------------------------------------------------------------------- # - Memory - shared_buffers = 512MB # min 128kB or
max_connections*16kB # - Free Space Map - max_fsm_pages = 409600 # min max_fsm_relations*16, 6 bytes
each The table structure is:
CREATE TABLE "public"."a_teste_nestle" (
"DATA" TIMESTAMP WITH TIME ZONE, "CODCLI" DOUBLE PRECISION, "VENDEDOR" DOUBLE PRECISION, "SUPERVISOR" DOUBLE PRECISION, "CODFILIAL" VARCHAR(2), "PRACA" DOUBLE PRECISION, "CONDVENDA" DOUBLE PRECISION, "QTITVENDIDOS" DOUBLE PRECISION, "PVENDA" DOUBLE PRECISION, "PESO" DOUBLE PRECISION, "CODPROD" VARCHAR(15), "CODFAB" VARCHAR(15), "DESCRICAO" VARCHAR(80), "CODGRUPONESTLE" DOUBLE PRECISION, "CODSUBGRUPONESTLE" DOUBLE PRECISION, "CODFAMILIANESTLE" DOUBLE PRECISION, "QTPESOPREV" DOUBLE PRECISION, "QTVENDAPREV" DOUBLE PRECISION, "VLVENDAPREV" DOUBLE PRECISION, "QT" DOUBLE PRECISION, "PUNIT" DOUBLE PRECISION ) WITHOUT OIDS; CREATE INDEX "a_teste_nestle_idx" ON "public"."a_teste_nestle"
USING btree ("DATA"); Thanks,
_________________________
Cláudia Macedo Amorim Consultora de Desenvolvimento PC Sistemas - www.pcsist.com.br (62) 3250-0200 claudia.amorim@xxxxxxxxxxxxxxxxxxxx Auto Serviço WinThor: um novo conceito em tecnologia, segurança e agilidade. |