Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0F54AB5DC5B for ; Fri, 16 Sep 2011 08:07:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 63230-02 for ; Fri, 16 Sep 2011 11:07:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from exprod7og119.obsmtp.com (exprod7og119.obsmtp.com [64.18.2.16]) by mail.postgresql.org (Postfix) with ESMTP id F3F5CB5DC5A for ; Fri, 16 Sep 2011 08:07:48 -0300 (ADT) Received: from mail-fx0-f47.google.com ([209.85.161.47]) (using TLSv1) by exprod7ob119.postini.com ([64.18.6.12]) with SMTP ID DSNKTnMuBI35sN4BTaxj6cow451EhtUA0ofw@postini.com; Fri, 16 Sep 2011 04:07:49 PDT Received: by fxi1 with SMTP id 1so2186962fxi.34 for ; Fri, 16 Sep 2011 04:07:47 -0700 (PDT) Received: by 10.223.58.139 with SMTP id g11mr1414018fah.14.1316171267195; Fri, 16 Sep 2011 04:07:47 -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 i5sm1221795fai.15.2011.09.16.04.07.45 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 16 Sep 2011 04:07:45 -0700 (PDT) Message-ID: <4E732DFF.9070900@enterprisedb.com> Date: Fri, 16 Sep 2011 14:07:43 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.21) Gecko/20110831 Icedove/3.1.13 MIME-Version: 1.0 To: Alexander Korotkov CC: pgsql-hackers Subject: Re: Double sorting split patch References: <4E72197B.9040602@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: 201109/776 X-Sequence-Number: 194965 On 15.09.2011 21:46, Alexander Korotkov wrote: > On Thu, Sep 15, 2011 at 7:27 PM, Heikki Linnakangas< > heikki.linnakangas@enterprisedb.com> wrote: > >> I've looked at the patch, and took a brief look at the paper - but I still >> don't understand the algorithm. I just can't get my head around the concepts >> of split pairs and left/right groups. Can you explain that in layman's >> terms? Perhaps an example would help? > > In short algorithm works as following: > 1) Each box can be projected to the axis as an interval. Box (x1,y1)-(x2,y2) > are projected to X axis as (x1,x2) interval and to the Y axis as (y1,y2) > interval. At the first step we search for splits of those intervals and > select the best one. > 2) At the second step produced split are converting into terms of boxes > and ambiguities are solving. > > Let's see a little deeper how intervals split search are performed by > considering an example. We've intervals (0,1), (1,3), (2,3), (2,4). We > assume intervals of the groups to be (0,a), (b,4). So, "a" can be some upper > bound of interval: {1,3,4}, and "b" can be some lower bound of inteval: > {0,1,2}. > We consider following splits: each "a" with greatest possible "b" > (0,1), (1,4) > (0,3), (2,4) > (0,4), (2,4) > and each "b" with least possible "a". In this example splits will be: > (0,1), (0,4) > (0,1), (1,4) > (0,3), (2,4) > By removing the duplicates we've following splits: > (0,1), (0,4) > (0,1), (1,4) > (0,3), (2,4) > (0,4), (2,4) Ok, thanks, I understand that now. > Proposed algorithm finds following splits by single pass on two arrays: one > sorted by lower bound of interval and another sorted by upper bound of > interval. That looks awfully complicated. I don't understand how that works. I wonder if two passes would be simpler? -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com