Arrays Design Question

From: Achilleus Mantzios <rnd(at)gatewaynet(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Arrays Design Question
Date: 2002-03-26 08:12:12
Message-ID: 02032610121202.09965@pc216
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
i am wondering about what could be the best design practice regarding
performance for the following problem:
I want to store the factors of a linear formula of unknown degree (but less
than 10) in a table for online stats/graphs on historical data (about 200 Mb).
I am thinking of
a) Store each formula as a float8[] array and then write a pgsql function in C
to compute the result given the value of variable x.
b) Add 10 columns of type float8 and store 0 values where the position of the
column exceeds the degree of the formula.

The array implementation seems more simple and more neat since it has no
assumptions about the maximal degree, but it is not standard SQL,
the JDBC might have problems with array types, and i dont know the performance
implications.

Could some one please give a point to read about arrays implementation in
postgresql, their performance, accessing arrays from server pgsql C
functions??

Thanx

--
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
tel: +30-10-8981112
fax: +30-10-8981877
email: it(at)dynacomtm(dot)com
rnd(at)gatewaynet(dot)com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2002-03-26 12:00:00 C Function with Arrays Question
Previous Message Tom Lane 2002-03-26 00:35:07 Re: call the same pl/pgsql procedure twice in the same connection