Re: MULTISET patch

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 patch
Date: 2010-12-27 11:15:45
Message-ID: AANLkTinch3fN7jmjAhQbuB=yKrh6ai-9dpmUr=EBfyd6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

some quick notes:

* trim_array - you use a deconstruct_array. It unpack all fields and
it could not be effective. Can we limit a unpacked array?

I searched on net. This function has a little bit unconptual name -
DB2 use a synonym for this function array_trim. Can we use this
synonym too?

Probably there could be a low level optimization - can we limit a
detoast processing? (It must not be a part of this patch).

* three state boolean - true, false, -1. I am not sure, if this is
correct style. Using a second variable can be a more clean
* you doesn't a realese a deconstructed array
* using a variable name "type"

+ it has a nice speedup for our array based functions (sort is 3x faster),
+ patch was applyed without problems
+ all test was passed

Questions:

should be a MULTISET, SUBMULTISET, MEMBER a reserved keywords?

I am for marking these words as reserved keywords, but it needs a wide
agreeement. Without agreement, I don't think so not optimal keyword
"OF" in MEMBER operator is significant issue.

Regards

Pavel Stehule

2010/12/27 Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>:
> On Mon, Dec 27, 2010 at 02:09, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> I have a free time and I can do a review of your patch. Please, can
>> send a last version and can send a links on documentation that you
>> used?
>
> Thanks! The latest patch attached.
> I've not written documentation yet, but I used the following site:
>
> [The SQL standard]
> - http://www.wiscorp.com/sql20nn.zip
> - http://www.wiscorp.com/sqlmultisets.zip
> [secondary information]
> - http://farrago.sourceforge.net/design/CollectionTypes.html
> - http://waelchatila.com/2005/05/18/1116485743467.html
> [Implementation in Oracle Database]
> - http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/conditions006.htm
> - http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/operators006.htm
>
> Here are the list of functions in the patch. Note that all of the
> functions treat arrays as one-dimensional (ex. [N][M] => [N * M])
> because there is no multi-dimensional arrays/multiset support
> in the SQL standard.
>
>  - [FUNCTION] cardinality(anyarray) => integer
>  - [FUNCTION] trim_array(anyarray, nTrimmed integer) => anyarray
>  - [FUNCTION] array_flatten(anyarray) => anyarray
>  - [FUNCTION] array_sort(anyarray) => anyarray
>  - [FUNCTION] set(anyarray) => anyarray
>  - [SYNTAX] $1 IS [NOT] A SET => boolean
>  - [SYNTAX] $1 [NOT] MEMBER OF $2 => boolean
>  - [SYNTAX] $1 [NOT] SUBMULTISET OF $2 => boolean
>  - [SYNTAX] $1 MULTISET UNION [ALL | DISTINCT] $2 => anyarray
>  - [SYNTAX] $1 MULTISET INTERSECT [ALL | DISTINCT] $22 => anyarray
>  - [SYNTAX] $1 MULTISET EXCEPT [ALL | DISTINCT] $22 => anyarray
>  - [AGGREGATE] collect(anyelement) => anyarray
>  - [AGGREGATE] fusion(anyarray) => anyarray
>  - [AGGREGATE] intersection(anyarray) => anyarray
>
> --
> Itagaki Takahiro
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2010-12-27 11:42:19 Re: Streaming replication as a separate permissions
Previous Message Magnus Hagander 2010-12-27 11:15:11 Re: Streaming replication as a separate permissions