Re: MULTISET patch - Mailing list pgsql-hackers
From | Pavel Stehule |
---|---|
Subject | Re: MULTISET patch |
Date | |
Msg-id | AANLkTinch3fN7jmjAhQbuB=yKrh6ai-9dpmUr=EBfyd6@mail.gmail.com Whole thread Raw |
In response to | Re: MULTISET patch (Itagaki Takahiro <itagaki.takahiro@gmail.com>) |
Responses |
Re: MULTISET patch
|
List | 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.takahiro@gmail.com>: > On Mon, Dec 27, 2010 at 02:09, Pavel Stehule <pavel.stehule@gmail.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 >
pgsql-hackers by date: