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 23954D1BA97 for ; Fri, 5 Sep 2003 01:55:08 +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 75914-02 for ; Thu, 4 Sep 2003 22:55:01 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 66829D1BAA3 for ; Thu, 4 Sep 2003 22:54:57 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h851svDj046452 for ; Fri, 5 Sep 2003 01:54:57 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h851aFOE043394 for pgsql-performance@postgresql.org; Fri, 5 Sep 2003 01:36:15 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 04 Sep 2003 21:26:14 -0400 Organization: cbbrowne Computing Inc Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:oRLWmsxHdfbzDVAr3LAfQy1h71s= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/84 X-Sequence-Number: 3450 A long time ago, in a galaxy far, far away, "Relaxin" wrote: >> Have you changed any of the settings yet in postgresql.conf, >> specifically the shared_buffers setting? > > fsync = false > tcpip_socket = true > shared_buffers = 128 Change fsync to true (you want your data to survive, right?) and increase shared buffers to something that represents ~10% of your system memory, in blocks of 8K. So, if you have 512MB of RAM, then the total blocks is 65536, and it would likely be reasonable to increase shared_buffers to 1/10 of that, or about 6500. What is the value of effective_cache_size? That should probably be increased a whole lot, too. If you are mainly just running the database on your system, then it would be reasonable to set it to most of memory, or (* 1/2 (/ (* 512 1024 1024) 8192)) 32768. None of this is likely to substantially change the result of that one query, however, and it seems quite likely that it is because PostgreSQL is honestly returning the whole result set of ~100K rows at once, whereas the other DBMSes are probably using cursors to return only the few rows of the result that you actually looked at. -- "cbbrowne","@","cbbrowne.com" http://www3.sympatico.ca/cbbrowne/linuxdistributions.html Rules of the Evil Overlord #14. "The hero is not entitled to a last kiss, a last cigarette, or any other form of last request."