Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E2CDF9FB8E3; Thu, 11 Oct 2007 13:39:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 65185-08; Thu, 11 Oct 2007 13:39:20 -0300 (ADT) X-Greylist: delayed 00:25:14.989832 by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sumo.dreamhost.com (sumo.dreamhost.com [66.33.216.29]) by postgresql.org (Postfix) with ESMTP id 2017A9FB885; Thu, 11 Oct 2007 13:39:21 -0300 (ADT) Received: from spunkymail-a2.g.dreamhost.com (sd-green-bigip-207.dreamhost.com [208.97.132.207]) by sumo.dreamhost.com (Postfix) with ESMTP id 817B01F4623; Thu, 11 Oct 2007 09:12:27 -0700 (PDT) Received: from [192.168.1.110] (adsl-75-31-202-116.dsl.irvnca.sbcglobal.net [75.31.202.116]) by spunkymail-a2.g.dreamhost.com (Postfix) with ESMTP id 331ED87F29; Thu, 11 Oct 2007 09:12:23 -0700 (PDT) In-Reply-To: <21653.1192117985@sss.pgh.pa.us> References: <16663.1191597165@sss.pgh.pa.us> <6936504E-3560-4BE9-86BE-BEDAB3CD355A@araisoft.com> <3E8290A0-05DA-4F0F-A783-859124278D27@benjaminarai.com> <21653.1192117985@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <0041AF31-D807-4775-B7CF-745B0A1706E2@benjaminarai.com> Cc: Oleg Bartunov , PostgreSQL , pgsql-performance@postgresql.org Content-Transfer-Encoding: 7bit From: Benjamin Arai Subject: Re: [PERFORM] Slow TSearch2 performance for table with 1 million documents. Date: Thu, 11 Oct 2007 09:12:20 -0700 To: Tom Lane X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/509 X-Sequence-Number: 121801 Oh, I see. I didn't look carefully at the EXPLAIN ANALYZE I posted. So, is there a solution to the rank problem? Benjamin On Oct 11, 2007, at 8:53 AM, Tom Lane wrote: > Benjamin Arai writes: >> It appears that the ORDER BY rank operation is the slowing factor. >> If I remove it then the query is pretty fast. Is there another way >> to perform ORDER BY such that it does not do a sort? > > I think you misunderstood: it's not the sort that's slow, it's the > computation of the rank() values that are inputs to the sort. > > regards, tom lane >