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 062B2D1B461 for ; Thu, 27 Nov 2003 04:38:59 +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 24019-09 for ; Thu, 27 Nov 2003 00:38:20 -0400 (AST) Received: from houston.familyhealth.com.au (fhnet.arach.net.au [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id EA5D8D1B45F for ; Thu, 27 Nov 2003 00:38: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 hAR4beoD053430; Thu, 27 Nov 2003 12:37:41 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <3FC58097.8090803@familyhealth.com.au> Date: Thu, 27 Nov 2003 12:41:59 +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: Steve Atkins Cc: pgsql-performance@postgresql.org Subject: Re: For full text indexing, which is better, tsearch2 or References: <4c0ccf4c27ff.4c27ff4c0ccf@jhmimail.jhmi.edu> <3FC54A82.2040605@familyhealth.com.au> <20031127032831.GA4836@gp.word-to-the-wise.com> In-Reply-To: <20031127032831.GA4836@gp.word-to-the-wise.com> 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/288 X-Sequence-Number: 4848 > Does anyone have any metrics on how fast tsearch2 actually is? > > I tried it on a synthetic dataset of a million documents of a hundred > words each and while insertions were impressively fast I gave up on > the search after 10 minutes. > > Broken? Unusable slow? This was on the last 7.4 release candidate. I just created a 1.1million row dataset by copying one of our 30000 row production tables and just taking out the txtidx column. Then I inserted it into itself until it had 1.1 million rows. Then I created the GiST index - THAT took forever - seriously like 20 mins or half an hour or something. Now, to find a word: select * from tsearchtest where ftiidx ## 'curry'; Time: 9760.75 ms The AND of two words: Time: 103.61 ms The AND of three words: select * from tsearchtest where ftiidx ## 'curry&green&thai'; Time: 61.86 ms And now a one word query now that buffers are cached: select * from tsearchtest where ftiidx ## 'curry'; Time: 444.89 ms So, I have no idea why you think it's slow? Perhaps you forgot the 'create index using gist' step? Also, if you use the NOT (!) operand, you can get yourself into a really slow situation. Chris