pg.ddx.io  pgsql-students@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <aekorotkov@gmail.com>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Stas Kelvich <stas.kelvich@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: pgsql-students@postgresql.org
Subject: Re: [HACKERS] Cube extension point support // GSoC'13
Date: Mon, 21 Oct 2013 23:18:40 +0400
Message-ID: <CAPpHfduVqAv7M4HO4RqEESTaC1zZ+wkCc-GtdGD++02FiGEunQ@mail.gmail.com> (raw)
In-Reply-To: <52657B1C.7050906@vmware.com>
References: <23364502-F542-4553-A658-4D3A2B6FCFA9@gmail.com>
	<5236A9BC.3030000@vmware.com>
	<EF7A0879-4E83-4AAE-997D-222D6761E1C6@gmail.com>
	<CA+TgmoZdaou7E9wBApexPkYvOiEKBW2Xp8+G6rNFYxav8gVT4Q@mail.gmail.com>
	<5258038C.9070409@vmware.com>
	<CAPpHfdu-6COA6VA+50Q9cF=rEGn3DnzvhnUjbkpqXj4m_1zAVg@mail.gmail.com>
	<52657B1C.7050906@vmware.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-students>

On Mon, Oct 21, 2013 at 11:06 PM, Heikki Linnakangas <
hlinnakangas@vmware.com> wrote:

> On 11.10.2013 17:39, Alexander Korotkov wrote:
>
>> On Fri, Oct 11, 2013 at 5:56 PM, Heikki Linnakangas<hlinnakangas@**
>> vmware.com <hlinnakangas@vmware.com>
>>
>>> 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.
>

I will ask Teodor about it. When situation will be completely clear we
should cleanup confusing comments.
Also, too long GiST key shouldn't cause GiST to fall in its internals. We
should add check somewhere before.

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! :-)


Stas, congratulations from me too! Now, it's time to rebase another patches
against head. :)

------
With best regards,
Alexander Korotkov.

view thread (12+ messages)  latest in thread

Message-ID: <CAPpHfduVqAv7M4HO4RqEESTaC1zZ+wkCc-GtdGD++02FiGEunQ@mail.gmail.com>
Permalink:  ../CAPpHfduVqAv7M4HO4RqEESTaC1zZ+wkCc-GtdGD++02FiGEunQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CAPpHfduVqAv7M4HO4RqEESTaC1zZ+wkCc-GtdGD++02FiGEunQ@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-students@postgresql.org
  Cc: aekorotkov@gmail.com, hlinnakangas@vmware.com, stas.kelvich@gmail.com, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] Cube extension point support // GSoC'13
  In-Reply-To: <CAPpHfduVqAv7M4HO4RqEESTaC1zZ+wkCc-GtdGD++02FiGEunQ@mail.gmail.com>
  References: <23364502-F542-4553-A658-4D3A2B6FCFA9@gmail.com> <5236A9BC.3030000@vmware.com> <EF7A0879-4E83-4AAE-997D-222D6761E1C6@gmail.com> <CA+TgmoZdaou7E9wBApexPkYvOiEKBW2Xp8+G6rNFYxav8gVT4Q@mail.gmail.com> <5258038C.9070409@vmware.com> <CAPpHfdu-6COA6VA+50Q9cF=rEGn3DnzvhnUjbkpqXj4m_1zAVg@mail.gmail.com> <52657B1C.7050906@vmware.com> <CAPpHfduVqAv7M4HO4RqEESTaC1zZ+wkCc-GtdGD++02FiGEunQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox