Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYKny-0000AS-97 for pgsql-students@arkaria.postgresql.org; Mon, 21 Oct 2013 19:06:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VYKnx-0003Fo-Jm for pgsql-students@arkaria.postgresql.org; Mon, 21 Oct 2013 19:06:17 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYKnw-0003Fd-KI; Mon, 21 Oct 2013 19:06:16 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYKnp-0005Zn-Pu; Mon, 21 Oct 2013 19:06:16 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 8BD5A2928C; Mon, 21 Oct 2013 12:06:07 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 8743618133; Mon, 21 Oct 2013 12:06:07 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 723DD120031; Mon, 21 Oct 2013 12:13:09 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Mon, 21 Oct 2013 12:13:08 -0700 (PDT) Message-ID: <52657B1C.7050906@vmware.com> Date: Mon, 21 Oct 2013 22:06:04 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Alexander Korotkov CC: Stas Kelvich , Robert Haas , pgsql-hackers , pgsql-students@postgresql.org Subject: Re: [HACKERS] Cube extension point support // GSoC'13 References: <23364502-F542-4553-A658-4D3A2B6FCFA9@gmail.com> <5236A9BC.3030000@vmware.com> <5258038C.9070409@vmware.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.3 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-students Precedence: bulk Sender: pgsql-students-owner@postgresql.org On 11.10.2013 17:39, Alexander Korotkov wrote: > On Fri, Oct 11, 2013 at 5:56 PM, Heikki Linnakangas> wrote: > >> 2. I didn't understand this change: >> >> @@ -422,24 +439,14 @@ g_cube_union(PG_FUNCTION_ARGS) >>> Datum >>> g_cube_compress(PG_FUNCTION_**ARGS) >>> { >>> - PG_RETURN_DATUM(PG_GETARG_**DATUM(0)); >>> + GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); >>> + PG_RETURN_POINTER(entry); >>> } >>> >>> Datum >>> g_cube_decompress(PG_FUNCTION_**ARGS) >>> { >>> GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); >>> - NDBOX *key = DatumGetNDBOX(PG_DETOAST_**DATUM(entry->key)); >>> - >>> - if (key != DatumGetNDBOX(entry->key)) >>> - { >>> - GISTENTRY *retval = (GISTENTRY *) >>> palloc(sizeof(GISTENTRY)); >>> - >>> - gistentryinit(*retval, PointerGetDatum(key), >>> - entry->rel, entry->page, >>> - entry->offset, FALSE); >>> - PG_RETURN_POINTER(retval); >>> - } >>> PG_RETURN_POINTER(entry); >>> } >>> >>> >> What did the removed code do, and why isn't it needed anymore? > > I don't understand this place even more generally. What decompress function > do is to detoast key and return new gist entry with it if needed. But can > GiST key ever be toasted? My experiments show that answer is no, it can't. > When too long key is passed then GiST falls during inserting key into page. > And I didn't find any code doing GiST key toast in git. I guess it can't happen. Or is it possible that a toasted value that came from disk will be passed to these functions, without detoasting them somewhere along the way? Not sure. In any case, I've committed this patch now. I left out the changes to compress and decompress functions, as that's unrelated to the patch at hand. I ran the regression test on a Windows VM, and updated the expected output file that the Windows build used. That leaves two alternative expected output files unmodified - the buildfarm will tell us whether they're still needed. Thanks and congrats on your first committed patch, Stas! :-) - Heikki -- Sent via pgsql-students mailing list (pgsql-students@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-students