X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 77223D1B53B for ; Fri, 10 Oct 2003 17:10:26 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 55638-07 for ; Fri, 10 Oct 2003 14:09:38 -0300 (ADT) Received: from chimta04.algx.net (mta5.algx.net [67.92.168.234]) by svr1.postgresql.org (Postfix) with ESMTP id 6CDB7D1B513 for ; Fri, 10 Oct 2003 14:09:37 -0300 (ADT) Received: from JSH ([67.92.23.74]) by chimmx04.algx.net (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with SMTP id <0HMJ002AYWZYCX@chimmx04.algx.net> for pgsql-performance@postgresql.org; Fri, 10 Oct 2003 12:09:37 -0500 (CDT) Date: Fri, 10 Oct 2003 13:09:34 -0400 From: Jason Hihn Subject: Re: One or more processor ? In-reply-to: <3F86E15C.1010309@potentialtech.com> To: Bill Moran , =?iso-8859-15?Q?Herv=E9_Piedvache?= Cc: Postgresql Performance Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Content-type: text/plain; charset=iso-8859-15 Content-transfer-encoding: 8BIT Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/348 X-Sequence-Number: 4096 > -----Original Message----- > From: pgsql-performance-owner@postgresql.org > [mailto:pgsql-performance-owner@postgresql.org]On Behalf Of Bill Moran > Sent: Friday, October 10, 2003 12:42 PM > To: Hervé Piedvache > Cc: Postgresql Performance > Subject: Re: [PERFORM] One or more processor ? > > > Hervé Piedvache wrote: > > Hi, > > > > A simple question about PostgreSQL ... I have a Pentium Xeon > Quadri processors > > ... > > If I do a SQL request ... does PostgreSQL use one or more processor ? > > PostgreSQL uses one processor per connection. If you have 4 simultaneous > connections, you'll use all four processors (assuming your > operating system > is properly designed/configured). > > > And if it use only one ... why ? > > Could you explain me this ;o) > > The answer to that is beyond my knowledge, but I have a few guesses: > 1) Doing so is more complicated than you think. You need to be able to paralellize the algorithm. Even so, a 99% paralelizable algorithm over 2 cpus is only 50% faster than 1 cpu. So choose your poison: 2 processes @100% in 1tu or 1 process at 150% at .66tu (tu=time unit). This ofcourse is over simplification. I don't think 99% is reasonable in query processing (though it can depend on the query) so I expect the 2 connection method to be better, unless you only ever have 1 connection.