X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5D0D29DCE0C for ; Thu, 12 Jan 2006 16:16:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62699-08 for ; Thu, 12 Jan 2006 16:16:04 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.197]) by postgresql.org (Postfix) with ESMTP id DA90D9DCE09 for ; Thu, 12 Jan 2006 16:16:01 -0400 (AST) Received: by wproxy.gmail.com with SMTP id i28so529754wra for ; Thu, 12 Jan 2006 12:16:03 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AkLG99mw+iVMlqg7lDjPv22IN7QJpK1uzb4itQY5Hokkmt8DZqWDltdSF+Osa9Vo4GUz2VzxpcIn+KDieTDbOXbLQB0WZbVdbif19om7PH4TzCAMQZ2njA3TftlPB5/oGgqHBdP1yFpKyjNnEzxjPCK5I2Z55kdyJpNNzO/q4N4= Received: by 10.54.112.5 with SMTP id k5mr2901659wrc; Thu, 12 Jan 2006 12:16:00 -0800 (PST) Received: by 10.54.93.8 with HTTP; Thu, 12 Jan 2006 12:16:00 -0800 (PST) Message-ID: Date: Thu, 12 Jan 2006 15:16:00 -0500 From: Jaime Casanova To: Jamal Ghaffour Subject: Re: Please Help: PostgreSQL performance Optimization Cc: pgsql-performance@postgresql.org In-Reply-To: <43C66D67.1000502@elios-informatique.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <43C66742.9060104@elios-informatique.fr> <43C66D67.1000502@elios-informatique.fr> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.086 required=5 tests=[AWL=0.086] X-Spam-Score: 0.086 X-Spam-Level: X-Archive-Number: 200601/163 X-Sequence-Number: 16641 On 1/12/06, Jamal Ghaffour wrote: > Jamal Ghaffour a =E9crit : > Hi, I'm working on a project, whose implementation deals with PostgreSQL. A > brief description of our application is given below. I'm running version > 8.0 on a dedicated server 1Gb of RAM. my database isn't complex, it > contains just 2 simple tables. CREATE TABLE cookies ( domain varchar(50) > NOT NULL, path varchar(50) NOT NULL, name varchar(50) NOT NULL, > principalid varchar(50) NOT NULL, host text NOT NULL, value text NOT > NULL, secure bool NOT NULL, timestamp timestamp with time zone NOT NULL > DEFAULT CURRENT_TIMESTAMP+TIME '04:00:00', PRIMARY KEY > (domain,path,name,principalid) ) CREATE TABLE liberty ( principalid > varchar(50) NOT NULL, requestid varchar(50) NOT NULL, spassertionurl text > NOT NULL, libertyversion varchar(50) NOT NULL, relaystate varchar(50) NOT > NULL, PRIMARY KEY (principalid) ) I'm developping an application that uses > the libpqxx to execute psql queries on the database and have to execute 500 > requests at the same time. UPDATE cookies SET host=3D'ping.icap-elios.com', > value=3D '54E5B5491F27C0177083795F2E09162D', secure=3DFALSE, > timestamp=3DCURRENT_TIMESTAMP+INTERVAL '14400 SECOND' WHERE > domain=3D'ping.icap-elios.com' AND path=3D'/tfs' AND > principalid=3D'192.168.8.219' AND name=3D'jsessionid' SELECT path, upper(name) > AS name, value FROM cookies WHERE timestamp principalid=3D'192.168.8.219' AND secure=3DFALSE AND > (domain=3D'ping.icap-elios.com' OR domain=3D'.icap-elios.com') I have to notify > that the performance of is extremely variable and irregular. I can also see > that the server process uses almost 100% of a CPU. I'm using the default > configuration file, and i m asking if i have to change some paramters to > have a good performance. Any help would be greatly appreciated. Thanks, > Hi, > > There are some results that can give you concrete idea about my problem: > when i 'm launching my test that executes in loop manner the SELECT and > UPDATE queries described above, i'm obtaining this results: > > UPDATE Time execution :0s: 5225 us > SELECT Time execution :0s: 6908 us > > 5 minutes Later: > > UPDATE Time execution :0s: 6125 us > SELECT Time execution :0s: 10928 us > > 5 minutes Later: > > UPDATE Time execution :0s: 5825 us > SELECT Time execution :0s: 14978 us > > As you can see , the time execution of the SELECT request is growing > relatively to time and not the UPDATE time execution. > I note that to stop the explosion of the Select time execution, i m usin= g > frequently the vaccum query on the cookies table. > Set the autovacuum parmaeter in the configuation file to on wasn't able= to > remplace the use of the vaccum command, and i don't know if this behaivou= r > is normal? > > Thanks, > Jamal > > please execute EXPLAIN ANALYZE and show the results, is the only way to know what's happening -- regards, Jaime Casanova (DBA: DataBase Aniquilator ;)