Skip to content

Ideas #1

Closed
Closed

Description

@ankane

Plan

  • Use pairing heap for index scan for performance - stages branch
  • Use mini-batch k-means for index creation for reduced memory - minibatch branch
  • Add support for product quantization (in-progress)

Ideas

  • Use tuplesort_set_bound for performance - bound branch (not needed w/ pairing heap)
  • Add functions to view lists and/or pages like pageinspect (require superuser)

On-hold

  • Add support for parallel index scans (planner gets cost estimate but doesn't use) - parallel-index-scan branch
  • Change return type of distance functions from float8 to float4 for performance (maybe, needs benchmarking)

Activity

  1. yjhjstz commented on May 2, 2021

    @yjhjstz

    look forward parallel index scans.

  2. lensky84 commented on May 25, 2021

    @lensky84

    Hello!

    Is it possible to have more than 1024 dimensions? 2048 for example?

  3. ankane commented on May 26, 2021

    @ankane
    MemberAuthor

    There aren't any plans to support more dimensions, but you could fork the project and try it.

  4. yjhjstz commented on Jun 4, 2021

    @yjhjstz

    the simple way is "./configure --with-blocksize=32" , so that has bigger page block . @ankane @lensky84

  5. calebj commented on Oct 14, 2021

    @calebj

    I'd like to propose support for aggregation of vectors, which would allow something like

    SELECT label, count(sublabel), vector_norm(sum(embedding)) FROM sometable GROUP BY label;

    or other advanced scenarios that use a window to perform a running vector average, or weighting each summed vector based on another column (which would also need element-wise multiplication defined).

  6. mikeizbicki commented on Oct 14, 2021

    @mikeizbicki

    @calebj This feature is currently implemented in the open pull request #13.

  7. calebj commented on Oct 14, 2021

    @calebj

    @calebj This feature is currently implemented in the open pull request #13.

    Oh, sweet. Somehow I overlooked that. I'll see if it fits our use case and report any issues I encounter in that thread 👍🏼

  8. LazyDBA247-Anyvision commented on Nov 13, 2021

    @LazyDBA247-Anyvision

    @ankane First of all amazing project, Thank You!

    1. did you ever think of adding support for GPU index (FAISS, flat index which supports all operations(add/remove/update)), so it will be possible to "enable" when you compiled faiss + have a nvidia card.
      something like https://milvus.io/ but much easier as this is already backed into our database :)

    2. any optimizations on running batch queries (when you send 2+ vectors) and get for each it topK.
      today you need to join the vector and use some row_number function to get the topK for each vector.
      example (get topK 10, for 10 items on 1 scan of the table):

    select "itemId","vectorId", score from (
    				select "itemId","vectorId", score, row_number() over (partition by "subjectId" order by score desc) as rown
    				from (	
    					select "itemId","vectorsToCheck"."vectorId",inner_product(a.features, "vectorsToCheck".features)::float4 as score
    					from "itemFeatures" a, (select * from query_data limit 10) "vectorsToCheck"
    					) c 
    				) d
    where rown <= 10
    

    10x!

  9. ankane commented on Nov 16, 2021

    @ankane
    MemberAuthor

    Hi @LazyDBA247-Anyvision, there aren't any plans to add GPU support, but would be neat if someone in the community wanted to prototype it.

    For batch queries, there aren't currently any optimizations, and I'm not entirely sure it's possible with how Postgres queries are executed (but someone with deeper knowledge may know better).

  10. ankane commented on May 25, 2022

    @ankane
    MemberAuthor

    Moved to #27

  11. Leonardo-Ferreira commented on Feb 23, 2026

    @Leonardo-Ferreira

    Hi @LazyDBA247-Anyvision, there aren't any plans to add GPU support, but would be neat if someone in the community wanted to prototype it.
    For batch queries, there aren't currently any optimizations, and I'm not entirely sure it's possible with how Postgres queries are executed (but someone with deeper knowledge may know better).

    @ankane is this still the current position of the project leadership?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions