Re: Cube extension improvement, GSoC - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Cube extension improvement, GSoC
Date
Msg-id CAPpHfdvU37sPHa0XeecrN3=54CPKeMqqRWzbpqXtHeFH3YsLCQ@mail.gmail.com
Whole thread Raw
In response to Re: Cube extension improvement, GSoC  (Stas Kelvich <stanconn@gmail.com>)
Responses Re: Cube extension improvement, GSoC
List pgsql-hackers
On Sat, May 4, 2013 at 11:19 PM, Stas Kelvich <stanconn@gmail.com> wrote:
> I think we have at least 3 data types more or less similar to cube.
> 1) array of ranges
> 2) range of arrays
> 3) 2d arrays
> Semantically cube is most close to array or ranges. However array of ranges have huge storage overhead.
> Also we can declare cube as domain on 2d arrays and declare operations of that domain.

But what we should do when arrays in different records have different numbers of element?

We can be faced with absolutely same situation with cube.

test=# create table cube_test (v cube);
CREATE TABLE

test=# insert into cube_test values (cube(array[1,2])), (cube(array[1,2,3]));
INSERT 0 2

In order to force all cubes to have same number of dimensions excplicit CHECK on table is required.
As I remember cube treats absent dimensions as zeros.

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

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: GSOC Student Project Idea
Next
From: Heikki Linnakangas
Date:
Subject: Re: Terminology issue: suffix tree