X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DE5FADB09A for ; Thu, 27 Oct 2005 18:59:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 58480-01 for ; Thu, 27 Oct 2005 21:58:56 +0000 (GMT) Received: from madoka.pendragon.org (www.pendragon.org [216.194.85.20]) by svr1.postgresql.org (Postfix) with ESMTP id F3DA7DB098 for ; Thu, 27 Oct 2005 18:58:57 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by madoka.pendragon.org (Postfix) with ESMTP id 5455C112EDA for ; Thu, 27 Oct 2005 15:46:34 -0600 (MDT) Received: from madoka.pendragon.org ([127.0.0.1]) by localhost (madoka.pendragon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01508-01 for ; Thu, 27 Oct 2005 15:46:33 -0600 (MDT) Received: from [192.168.2.102] (130.209-89-70-0.interbaun.com [209.89.70.130]) by madoka.pendragon.org (Postfix) with ESMTP id 07C9F112ED9 for ; Thu, 27 Oct 2005 15:46:32 -0600 (MDT) Message-ID: <43614D9F.9010600@pendragon.org> Date: Thu, 27 Oct 2005 15:58:55 -0600 From: Michael Best User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: how postgresql request the computer resources References: <4360F8C1.4040202@archonet.com> In-Reply-To: <4360F8C1.4040202@archonet.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at pendragon.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200510/432 X-Sequence-Number: 15200 Richard Huxton wrote: >> WITH ANY OF THIS QUERIES MSSQL TAKES NOT MUCH OF 7 SECONDS.... > > > In which case they make a bad choice for showing PostgreSQL is faster > than MSSQL. Is this the only query you have, or are others giving you > problems too? > > I think count(*) is about the weakest point in PG, but I don't think > there'll be a general solution available soon. As I'm sure someone has > mentioned, whatever else, PG needs to check the row for its visibility > information. > > From the start of your email, you seem to suspect your configuration > needs some work. Once you are happy that your settings in general are > good, you can override some by issuing set statements before your query. > For example: > SET work_mem = 10000; > might well improve example #2 where you had a hash. > > -- > Richard Huxton > Archonet Ltd Someone had suggested keeping a vector table with +1 and -1 for row insertion and deletion and then running a cron to sum the vectors and update a table so that you could select from that table to get the row count. Perhaps some sort of SUM() on a column function. Since this seems like a reasonable approach (or perhaps there may be yet another better mechanism), cannot someone add this sort of functionality to Postgresql to do behind the scenes? -Mike