Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id B48442E0060 for ; Sat, 24 Nov 2007 08:00:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 75237-01 for ; Sat, 24 Nov 2007 08:00:19 -0400 (AST) Received: from pcinformatica.com.br (ns2.pcinformatica.com.br [201.24.152.2]) by postgresql.org (Postfix) with ESMTP id E71AA2E0081 for ; Sat, 24 Nov 2007 08:00:28 -0400 (AST) Received: (qmail 10177 invoked by uid 88); 24 Nov 2007 12:00:26 -0000 Received: from 127.0.0.1 by smart (envelope-from , uid 89) with qmail-scanner-1.25 (uvscan: v4.4.00/v4400. Clear:RC:1(127.0.0.1):. Processed in 0.422158 secs); 24 Nov 2007 12:00:26 -0000 X-Qmail-Scanner-Mail-From: claudia.amorim@pcinformatica.com.br via smart X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.422158 secs) X-Qmail-Util: Version 0.6.3 Received: from unknown (HELO 201.24.152.6) (127.0.0.1) by 0 with SMTP; 24 Nov 2007 12:00:25 -0000 Received: from 189.5.149.224 (SquirrelMail authenticated user claudia.amorim@pcinformatica.com.br) by smart with HTTP; Sat, 24 Nov 2007 10:00:25 -0200 (BRST) Message-ID: <50662.189.5.149.224.1195905625.squirrel@smart> In-Reply-To: <4747E684.2000509@enterprisedb.com> References: <50326.189.5.149.224.1195860047.squirrel@smart> <4747E684.2000509@enterprisedb.com> Date: Sat, 24 Nov 2007 10:00:25 -0200 (BRST) Subject: Re: Problems with PostGreSQL and Windows 2003 From: claudia.amorim@pcinformatica.com.br To: "Heikki Linnakangas" Cc: pgsql-performance@postgresql.org, claudiacomput@hotmail.com User-Agent: SquirrelMail/1.4.8 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/284 X-Sequence-Number: 27699 Hi, When I set shared buffers higher than 1GB, PostGreSQL doens't start. When my application crashes I receive a message "Out of memory" or "invalid sql statement". But the sql statement is ok - if I execute it in a table with less registers, it works and it is very simple. When I monitor the processes I can see that PostGreSQL allocs only 700 MB of memory, and my application 2GB. Total: 3GB. My program was made in Delphi 2006, and I use ADO via ODBC to connect to PostGreSQL. The structure of my table: CREATE TABLE "public"."fato_financeiro" ( "CODCLI" VARCHAR(6), "PREST" VARCHAR(4) NOT NULL, "NUMTRANSVENDA" VARCHAR(10) NOT NULL, "RECNUM" VARCHAR(8) NOT NULL, "CODFORNEC" VARCHAR(8), "TIPO" VARCHAR(2), "NUMDOC" VARCHAR(10), "PREST_1" VARCHAR(4), "VALOR" DOUBLE PRECISION, "DTEMISSAO" TIMESTAMP WITH TIME ZONE, "DTVENC" TIMESTAMP WITH TIME ZONE, "DTPAG" TIMESTAMP WITH TIME ZONE, "VPAGO" DOUBLE PRECISION, "PAGO_PAG" VARCHAR(9), "ATRASADO" VARCHAR(3), CONSTRAINT "fato_financeiro_idx" PRIMARY KEY("PREST", "NUMTRANSVENDA", "RECNUM") ) WITHOUT OIDS; SQL statement: select fato_financeiro."TIPO", fato_financeiro."NUMDOC", fato_financeiro."PREST", fato_financeiro."NUMDOC", fato_financeiro."DTVENC", fato_financeiro."DTPAG", fato_financeiro."PAGO_PAG", fato_financeiro."ATRASADO", fato_financeiro."CODCLI", fato_financeiro."CODFORNEC", fato_financeiro."DTEMISSAO" from fato_financeiro Thanks, Cláudia. > claudia.amorim@pcinformatica.com.br wrote: >> I'm having serious peformance problems with PostGreSQL and Windows Server 2003 >> Enterprise Edition. The PostgreSQL Server don't starts if I set the shared >> buffers high than >> 1GB. All my programs can use only 3 GB of RAM and I have 8GB of RAM. >> When I try to execute a query in a table about 4 milion registers, my >> application crashes with an error memory message. > > What error message do you get if setting shared_buffers higher than 1GB? > Exactly what error message do you get when the application crashes? > >> work_mem =512MB # min 64kB > > That's way too high for most applications. In a complex query, each sort > or hash node can will use up work_mem amount of memory. That means that > if you have a very complex query with several such nodes, it will run > out of memory. Try something like 16MB. > > > -- > Heikki Linnakangas > EnterpriseDB http://www.enterprisedb.com > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend >