Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CB51365021B for ; Wed, 26 Nov 2008 16:33:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 50727-06 for ; Wed, 26 Nov 2008 16:33:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.147]) by mail.postgresql.org (Postfix) with ESMTP id 3B00E6501DC for ; Wed, 26 Nov 2008 16:33:19 -0400 (AST) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by ptb-relay03.plus.net with esmtp (Exim) id 1L5R4X-0000mb-70; Wed, 26 Nov 2008 20:33:17 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id CEB4F27406B; Wed, 26 Nov 2008 20:33:13 +0000 (GMT) Message-ID: <492DB289.8020703@archonet.com> Date: Wed, 26 Nov 2008 20:33:13 +0000 From: Richard Huxton User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: Andrus CC: mweilguni@sime.com, pgsql-performance@postgresql.org Subject: Re: Increasing pattern index query speed References: <492A7591.3000700@archonet.com> <492D27C8.7090206@archonet.com> <4936D68EF8C84087BBB9212C4019D5D8@andrusnotebook> <492D9E78.9080902@archonet.com> <534B7B28155C4275BD2B9AA8F3B656DD@andrusnotebook> In-Reply-To: <534B7B28155C4275BD2B9AA8F3B656DD@andrusnotebook> Content-Type: text/plain; charset=windows-1257 Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 801738b1a6ca6eabc77768c64b8be57f X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200811/270 X-Sequence-Number: 32001 Andrus wrote: > Richard, > >>> Results are provided in bottom of the message to which you replied. >> >> No - the explains there were contrasting a date test BETWEEN versus =. > > I changed rid.toode statitics target to 100: > > ALTER TABLE firma2.rid ALTER COLUMN toode SET STATISTICS 100; > analyze firma2.rid; > > Analyze takes 3 seconds and testcase rans fast. > I'm planning to monitor results by looking log file for queries which > take longer than 10 seconds. Sensible. I don't know if 10 seconds is the right value for your database, but there will be a point that filters out most of your traffic but still gives enough to find problems. > Do you still need results ? > If yes, which query and how many times should I run? If changing the statistics seems to help, you're not going to want to go back just to repeat tests. >> Ah, I think I understand. The test case was *missing* this clause. > > I added this clause to testcase. Also added char(70) colums containing > padding characters to all three tables. Cannot still reproduce this issue > in testcase in fast devel 8.3 notebook. > In testcase order_products contains product_id values in a very regular > order, maybe this affects the results. No idea how to use random() to > generate random > products for every order. Ideally you don't even want random products. You want a distribution of products that matches the same "shape" as you have in your production database. -- Richard Huxton Archonet Ltd