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 7B449D1D070 for ; Thu, 15 Apr 2004 07:29:43 -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 58497-08 for ; Thu, 15 Apr 2004 07:29:44 -0300 (ADT) Received: from trade-india.com (unknown [61.16.154.82]) by svr1.postgresql.org (Postfix) with SMTP id 0CB4AD1C4C3 for ; Thu, 15 Apr 2004 07:29:39 -0300 (ADT) Received: (qmail 21893 invoked from network); 15 Apr 2004 10:16:42 -0000 Received: from valium.trade-india-local.com (HELO trade-india.com) (192.168.0.72) by system66.trade-india-local.com with SMTP; 15 Apr 2004 10:16:42 -0000 Message-ID: <407E647E.7090207@trade-india.com> Date: Thu, 15 Apr 2004 16:01:26 +0530 From: Rajesh Kumar Mallah Organization: Infocom Network Limited User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Richard Huxton Cc: Postgres Performance Subject: Re: select count(*) very slow on an already vacuumed table. References: <407D7A89.60508@trade-india.com> <200404142008.58533.dev@archonet.com> <407E3563.6000408@trade-india.com> <200404150853.32475.dev@archonet.com> In-Reply-To: <200404150853.32475.dev@archonet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/171 X-Sequence-Number: 6471 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. > > Hi, Thanks for the interest . my config are not the default ones. i was running iostat while running the query. Looks like one of the disks doesnt' go past a read performance of 20 ,000 KBytes/sec while the other disk it goes as high as 40,000 . What i am ding currently is loading the table in both the disks and compare the table scan speeds. The performance is definitely better in the newly loaded table in the other disk . the load in server is 13 because i am simultaneously re-loading the data in other table. rt2=# SELECT count(*) from rfis where sender_uid > 0; +--------+ | count | +--------+ | 564870 | +--------+ (1 row) Time: 10288.359 ms rt2=# shall post the comparitive details under normal load soon regds mallah. > > >>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. > > >