Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 0A3731337BB0 for ; Tue, 12 Oct 2010 19:30:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 10463-04 for ; Tue, 12 Oct 2010 22:30:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lpo-relay-05.vmsinfo.com (lpo-relay-05.vmsinfo.com [216.169.137.116]) by mail.postgresql.org (Postfix) with ESMTP id 357861337B8F for ; Tue, 12 Oct 2010 19:30:41 -0300 (ADT) X-IronPort-AV: E=Sophos;i="4.57,322,1283745600"; d="scan'208";a="29356137" Received: from unknown (HELO lpo-mailbox-01.vmsinfo.com) ([216.169.137.252]) by lpo-relay-05.vmsinfo.com with ESMTP; 12 Oct 2010 18:30:39 -0400 Received: from [10.101.43.35] (unknown [216.169.135.235]) by lpo-mailbox-01.vmsinfo.com (Postfix) with ESMTP id EA3467D00B; Tue, 12 Oct 2010 18:30:38 -0400 (EDT) Message-ID: <4CB4E18E.2060906@vmsinfo.com> Date: Tue, 12 Oct 2010 18:30:38 -0400 From: Mladen Gogala Organization: VMS User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Pierre C CC: "pgsql-performance@postgresql.org" , Neil Whelchel Subject: Re: Slow count(*) again... References: <201010091626.18636.neil.whelchel@gmail.com> <201010111254.58479.neil.whelchel@gmail.com> <4CB3A2CC.9070009@vmsinfo.com> <201010111936.46207.neil.whelchel@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/184 X-Sequence-Number: 40603 Pierre C wrote: >> > > Well, suppose you paginate results. If the user sees that the search query > returns 500 pages, there are two options : > With Google, I usually lose patience on the page 3. All that I, as an end user, need to know is whether there are more than 10 pages. The fact that there are 1776 pages in the result set is not particularly useful to me. I couldn't care less whether the number of returned pages is 1492, 1776 or 1861, I'm going to look at, at most, the first 5 of them. > - you're google, and your sorting algorithms are so good that the answer > the user wants is in the first page > - or the user will refine his search by entering more keywords tu get a > manageable result set > > So, in both cases, the count(*) was useless anyway. And the slowest ones > are the most useless, since the user will immediatey discard the result > and refine his query. > > If your full text search is slow, try Xapian or Lucene. > > May I also recommend Sphinx? It's a very nice text search engine, with the price equal to that of Lucene. -- Mladen Gogala Sr. Oracle DBA 1500 Broadway New York, NY 10036 (212) 329-5251 http://www.vmsinfo.com The Leader in Integrated Media Intelligence Solutions