Re: compile cube extension with float4 precision storing - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: compile cube extension with float4 precision storing
Date
Msg-id 20200619173030.l3smiu3c3yp6ut2j@development
Whole thread Raw
In response to compile cube extension with float4 precision storing  (Siarhei D <siarhei.damanau@gmail.com>)
List pgsql-hackers
On Fri, Jun 12, 2020 at 02:41:08PM +0300, Siarhei D wrote:
>Is it possible to make cube extension with float(4bytes) precision instead
>of double(8bytes)?
>
>I use cube extension for storing embedding vectors and calculation distance
>on them. During comparing vectors, a 4byte float precision is enough.
>Storing 8 byte double precision is wasting disk space.
>
>Now to avoid disk wasting I store vectors as real[] array and create cube
>objects on the fly. But this solution is wasting cpu time
>

I don't think there's a built-in support for that, so the only option I
can think of is creating your own cube "copy" extension using float4.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Failures with installcheck and low work_mem value in 13~
Next
From: Robert Haas
Date:
Subject: Re: Creating a function for exposing memory usage of backend process