Re: Does people favor to have matrix data type? - Mailing list pgsql-hackers

From Ants Aasma
Subject Re: Does people favor to have matrix data type?
Date
Msg-id CA+CSw_ttk9XGgV5rtPpKd-E3BfBPt3W0dT5Qqq1Zjc9=Uar_=A@mail.gmail.com
Whole thread Raw
In response to Does people favor to have matrix data type?  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Responses Re: Does people favor to have matrix data type?  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
List pgsql-hackers
On Wed, May 25, 2016 at 10:38 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On 25 May 2016 at 03:52, Kouhei Kaigai <kaigai@ak.jp.nec.com> wrote:
>>
>> In a few days, I'm working for a data type that represents matrix in
>> mathematical area. Does people favor to have this data type in the core,
>> not only my extension?
>
>
> If we understood the use case, it might help understand whether to include
> it or not.
>
> Multi-dimensionality of arrays isn't always useful, so this could be good.

Many natural language and image processing methods extract feature
vectors that then use some simple distance metric, like dot product to
calculate vector similarity. For example we presented a latent
semantic analysis prototype at pgconf.eu 2015 that used real[] to
store the features and a dotproduct(real[], real[]) real function to
do similarity matching. However using real[] instead of a hypothetical
realvector or realmatrix did not prove to be a huge overhead, so
overall I'm on the fence for the usefulness of a special type. Maybe a
helper function or two to validate the additional restrictions in a
check constraint would be enough.

Regards,
Ants Aasma



pgsql-hackers by date:

Previous
From: Dmitry Igrishin
Date:
Subject: Deleting prepared statements from libpq.
Next
From: Kouhei Kaigai
Date:
Subject: Re: Does people favor to have matrix data type?