Thread: cube problem

cube problem

From
ABHANG RANE
Date:
Hi,
I have a table with one column as real[]. Now if I want to make cubes
out of each of
these arrays, is there a way in postgre I can do it. I guess cube
operator is not defined
for real[] but can I create cubes if the column was integer[]. If yes
please may I know
how.

Actually I would pass an real[] array to a function. I want to create a
cube out of this
so that, somehow I can calculate the distance between this cube and
each row in the table
which has a column of real[]. So I would have to create a cube for each
row in the table.
I can write a function which accepts array and calculate such distance
in C but thats too
slow since there are 10 million rows.

Thanks
Abhang


Re: cube problem

From
"Alexander Staubo"
Date:
On 6/8/07, ABHANG RANE <arane@indiana.edu> wrote:
> Hi,
> I have a table with one column as real[]. Now if I want to make cubes
> out of each of
> these arrays, is there a way in postgre I can do it. I guess cube
> operator is not defined
> for real[] but can I create cubes if the column was integer[]. If yes
> please may I know
> how.

There are several definitions of "cube" that could possibly fit your
question; which one do you mean?

* A cube operator as in an OLAP cube
(http://blogs.ittoolbox.com/database/technology/archives/olap-sql-part-1-rollup-7985).
Postgres does not support this. I's been brought up in the past, but
never fully implemented, though I think people have tried. The problem
perhaps a lack of demand among database developers.

* A three-dimensional geometric object
(http://en.wikipedia.org/wiki/Cube). Postgres doesn't support them
natively -- the geometric operators are all 2D -- but there's a module
in contrib called cube which implements "n-dimensional cubes", ie.
hypercubes, which can be used for geometry as well as other types of
multidimensional queries.

* An arithmetical expression
(http://en.wikipedia.org/wiki/Cube_%28algebra%29). Postgres does this.

Alexander.