Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 26793B5DC61 for ; Tue, 30 Aug 2011 07:43:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 05040-01 for ; Tue, 30 Aug 2011 10:43:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og112.obsmtp.com (exprod7og112.obsmtp.com [64.18.2.177]) by mail.postgresql.org (Postfix) with ESMTP id 672F7B5DC07 for ; Tue, 30 Aug 2011 07:43:27 -0300 (ADT) Received: from mail-fx0-f54.google.com ([209.85.161.54]) (using TLSv1) by exprod7ob112.postini.com ([64.18.6.12]) with SMTP ID DSNKTly+zmT7eb/s4QMFRYKr0sIAvoXOr72+@postini.com; Tue, 30 Aug 2011 03:43:28 PDT Received: by mail-fx0-f54.google.com with SMTP id 4so6785661fxe.13 for ; Tue, 30 Aug 2011 03:43:26 -0700 (PDT) Received: by 10.223.28.89 with SMTP id l25mr4955918fac.34.1314701006434; Tue, 30 Aug 2011 03:43:26 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id r12sm4478747fam.38.2011.08.30.03.43.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Aug 2011 03:43:25 -0700 (PDT) Message-ID: <4E5CBECB.2070002@enterprisedb.com> Date: Tue, 30 Aug 2011 13:43:23 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.20) Gecko/20110820 Icedove/3.1.12 MIME-Version: 1.0 To: Alexander Korotkov CC: Robert Haas , pgsql-hackers Subject: Re: WIP: Fast GiST index build References: <4E42DFCE.3050904@enterprisedb.com> <4E4AAC49.7070401@enterprisedb.com> <4E4AC0B9.8070203@enterprisedb.com> <4E4AC1C3.4070003@enterprisedb.com> <4E569D9A.4020308@enterprisedb.com> <4E5CA88C.50008@enterprisedb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/1326 X-Sequence-Number: 194081 On 30.08.2011 13:38, Alexander Korotkov wrote: > On Tue, Aug 30, 2011 at 1:08 PM, Heikki Linnakangas< > heikki.linnakangas@enterprisedb.com> wrote: > >> >> Thanks. Meanwhile, I hacked together my own set of test scripts, and let >> them run over the weekend. I'm still running tests with ordered data, but >> here are some preliminary results: >> >> testname | nrows | duration | accesses >> -----------------------------+**-----------+-----------------+**---------- >> points unordered auto | 250000000 | 08:08:39.174956 | 3757848 >> points unordered buffered | 250000000 | 09:29:16.47012 | 4049832 >> points unordered unbuffered | 250000000 | 03:48:10.999861 | 4564986 >> >> As you can see, the results are very disappointing :-(. The buffered builds >> take a lot *longer* than unbuffered ones. I was expecting the buffering to >> be very helpful at least in these unordered tests. On the positive side, the >> buffering made index quality somewhat better (accesses column, smaller is >> better), but that's not what we're aiming at. >> >> What's going on here? This data set was large enough to not fit in RAM, the >> table was about 8.5 GB in size (and I think the index is even larger than >> that), and the box has 4GB of RAM. Does the buffering only help with even >> larger indexes that exceed the cache size even more? >> > This seems pretty strange for me. Time of unbuffered index build shows that > there is not bottleneck at IO. That radically differs from my > experiments. I'm going to try your test script on my test setup. > While I have only express assumption that random function appears to be > somewhat bad. Thereby unordered dataset behave like the ordered one. Oh. Doing a simple "SELECT * FROM points LIMIT 10", it looks pretty random to me. The data should be uniformly distributed in a rectangle from (0, 0) to (100000, 100000). > Can you > rerun tests on your test setup with dataset generation on the backend like > this? > CREATE TABLE points AS (SELECT point(random(), random() FROM > generate_series(1,10000000)); Ok, I'll queue up that test after the ones I'm running now. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com