X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8E2D3D1B439 for ; Thu, 27 Nov 2003 00:59:35 +0000 (GMT) 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 04518-01 for ; Wed, 26 Nov 2003 20:59:13 -0400 (AST) Received: from houston.familyhealth.com.au (fhnet.arach.net.au [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id C9C45D1B43F for ; Wed, 26 Nov 2003 20:59:03 -0400 (AST) Received: from familyhealth.com.au (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9p1/8.12.9) with ESMTP id hAR0x8oD051309; Thu, 27 Nov 2003 08:59:09 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <3FC54D52.4040207@familyhealth.com.au> Date: Thu, 27 Nov 2003 09:03:14 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: LIANHE SHAO Cc: Neil Conway , pgsql-performance@postgresql.org Subject: Re: very large db performance question References: <4e2c4d4e061f.4e061f4e2c4d@jhmimail.jhmi.edu> In-Reply-To: <4e2c4d4e061f.4e061f4e2c4d@jhmimail.jhmi.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/285 X-Sequence-Number: 4845 > Thanks for reply. Actually our database only supply > some scientists to use (we predict that). so there > is no workload problem. there is only very > infrequent updates. the query is not complex. the > problem is, we have one table that store most of the > data ( with 200 million rows). In this table, there > is a text column which we need to do full text > search for each row. The result will then join the > data from another table which has 30,000 rows. Now > the query runs almost forever. Use TSearch2. > I tried a small table with 2 million rows using the > following simple command, it takes me about 6 > seconds to get the result back. So, I get confused. > That is why I ask: Is it the hardware problem or > something else. (I just vacuumed the whole database > yesterday). > > PGA=> select count (*) from expressiondata ; > count > --------- > 2197497 > (1 row) select count(*) on a postgres table ALWAYS does a sequential scan. Just don't do it. There are technical reasons (MVCC) why this is so. It's a bad "test". Chris