pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan S. Katz <jkatz@postgresql.org>
To: Oliver Rice <oliver@oliverrice.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers@postgresql.org
Cc: mail@joeconway.com
Subject: Re: vector search support
Date: Fri, 26 May 2023 10:32:18 -0400
Message-ID: <e083ced8-83a0-9b73-156b-da968b83ac9c@postgresql.org> (raw)
In-Reply-To: <44B7369A-AFB9-4694-B554-41BBDA2D7CEF@oliverrice.com>
References: <20230422000723.GB1527017@nathanxps13>
	<44B7369A-AFB9-4694-B554-41BBDA2D7CEF@oliverrice.com>

On 5/25/23 1:48 PM, Oliver Rice wrote:

> A nice side effect of using the float8[] to represent vectors is that it 
> allows for vectors of different sizes to coexist in the same column.
> 
> We most frequently see (pgvector) vector columns being used for storing 
> ML embeddings. Given that different models produce embeddings with a 
> different number of dimensions, the need to specify a vector’s size in 
> DDL tightly couples the schema to a single model. Support for variable 
> length vectors would be a great way to decouple those concepts. It would 
> also be a differentiating feature from existing vector stores.

I hadn't thought of that, given most of what I've seen (or at least my 
personal bias in designing systems) is you keep a vector of one 
dimensionality in a column. But this sounds like where having native 
support in a variable array would help.

> One drawback is that variable length vectors complicates indexing for 
> similarity search because similarity measures require vectors of 
> consistent length. Partial indexes are a possible solution to that challenge

Yeah, that presents a challenge. This may also be an argument for a 
vector data type, since that would eliminate the need to check for 
consistent dimensionality on the indexing.

Jonathan


Attachments:

  [application/pgp-signature] OpenPGP_signature (839B, ../e083ced8-83a0-9b73-156b-da968b83ac9c@postgresql.org/2-OpenPGP_signature)
  download

view thread (8+ messages)  latest in thread

Message-ID: <e083ced8-83a0-9b73-156b-da968b83ac9c@postgresql.org>
Permalink:  ../e083ced8-83a0-9b73-156b-da968b83ac9c@postgresql.org/
Also on:    postgresql.org/message-id/e083ced8-83a0-9b73-156b-da968b83ac9c@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: jkatz@postgresql.org, oliver@oliverrice.com, nathandbossart@gmail.com, mail@joeconway.com
  Subject: Re: vector search support
  In-Reply-To: <e083ced8-83a0-9b73-156b-da968b83ac9c@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox