Re: MULTISET and additional functions for ARRAY

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MULTISET and additional functions for ARRAY
Date: 2010-11-15 09:34:41
Message-ID: AANLkTima6hAsuW=SmNNrz=nLWq9sRGW=5WN7k5YoY2Mm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/11/15 Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>:
> On Mon, Nov 15, 2010 at 14:37, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> Maybe can be useful to implement a searching on sorted array.
>> You can hold a flag if multiset is sorted or not.
>
> Are you suggesting to add an IS_SORTED bit to for each ArrayType value?
> It might be possible, but I'm not sure how much it is useful.

It's depend on implementation. You can use this flag for large set and
operation MEMBER OF. When you know, so array is sorted, then you can
use a fast search.

>
> Another issue for sorting is that we have 4 kinds of sorting: ASC/DESC
> and NULLS FIRST/LAST. I always used the default sort order (ASC NULLS LAST)
> in the patch, but we might need to support all of them when we export the
> functionality. Then, we would need 2 bits for IS_SORTED flags.
>

yes, probably

Pavel

> --
> Itagaki Takahiro
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2010-11-15 09:58:22 Re: MULTISET and additional functions for ARRAY
Previous Message Alexander Korotkov 2010-11-15 09:06:44 Re: Fix for seg picksplit function