X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7BDD7D1D06F for ; Thu, 15 Apr 2004 09:13:34 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 01833-02 for ; Thu, 15 Apr 2004 09:13:35 -0300 (ADT) Received: from mail.unisoftbg.com (unknown [194.12.229.207]) by svr1.postgresql.org (Postfix) with ESMTP id 05806D1B515 for ; Thu, 15 Apr 2004 09:13:27 -0300 (ADT) Received: (qmail 15175 invoked by uid 507); 15 Apr 2004 12:20:47 -0000 Received: from unknown (HELO t1.unisoftbg.com) (pginfo%t1.unisoftbg.com@194.12.229.193) by 0 with SMTP; 15 Apr 2004 12:20:47 -0000 Message-ID: <407E6AF8.7643C61F@t1.unisoftbg.com> Date: Thu, 15 Apr 2004 12:59:04 +0200 From: pginfo X-Mailer: Mozilla 4.03 [en] (Win95; I) MIME-Version: 1.0 To: Rajesh Kumar Mallah Cc: Richard Huxton , Postgres Performance Subject: Re: [ SOLVED ] select count(*) very slow on an already References: <407D7A89.60508@trade-india.com> <200404142008.58533.dev@archonet.com> <407E3563.6000408@trade-india.com> <200404150853.32475.dev@archonet.com> <407E7391.4060706@trade-india.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/174 X-Sequence-Number: 6474 Hi , I am not sure, but I remember the same problem. It was ot 7.3.x version and and I needet to reindex the table. I think after 7.4 vacuum also work correct with reindex. But I am not sure. regards, ivan. Rajesh Kumar Mallah wrote: > Hi, > > The problem was solved by reloading the Table. > the query now takes only 3 seconds. But that is > not a solution. > > The problem is that such phenomenon obscures our > judgement used in optimising queries and database. > > If a query runs slow we really cant tell if its a problem > with query itself , hardware or dead rows. > > I already did vacumm full on the table but it still did not > have that effect on performance. > In fact the last figures were after doing a vacuum full. > > Can there be any more elegent solution to this problem. > > Regds > Mallah. > > Richard Huxton wrote: > > >On Thursday 15 April 2004 08:10, Rajesh Kumar Mallah wrote: > > > > > >>The problem is that i want to know if i need a Hardware upgrade > >>at the moment. > >> > >>Eg i have another table rfis which contains ~ .6 million records. > >> > >> > > > > > > > >>SELECT count(*) from rfis where sender_uid > 0; > >> > >> > > > > > > > >>Time: 117560.635 ms > >> > >>Which is approximate 4804 records per second. Is it an acceptable > >>performance on the hardware below: > >> > >>RAM: 2 GB > >>DISKS: ultra160 , 10 K , 18 GB > >>Processor: 2* 2.0 Ghz Xeon > >> > >> > > > >Hmm - doesn't seem good, does it? If you run it again, is it much faster > >(since the data should be cached then)? What does "vmstat 10" show while > >you're running the query? > > > >One thing you should have done is read the performance tuning guide at: > > http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php > >The default values are very conservative, and you will need to change them. > > > > > > > >>What kind of upgrades shoud be put on the server for it to become > >>reasonable fast. > >> > >> > > > >If you've only got one disk, then a second disk for OS/logging. Difficult to > >say more without knowing numbers of users/activity etc. > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org