[HN Gopher] Vectors are the new JSON in PostgreSQL
       ___________________________________________________________________
        
       Vectors are the new JSON in PostgreSQL
        
       Author : lawrencechen
       Score  : 25 points
       Date   : 2023-06-26 16:27 UTC (6 hours ago)
        
 (HTM) web link (jkatz05.com)
 (TXT) w3m dump (jkatz05.com)
        
       | j_crick wrote:
       | Years go by, and I, a simple webdev basement dweller, just can't
       | stop looking at Postgres and think once in a while: "man, what
       | _can't_ this thing do?"
       | 
       | (Of course it can't do a lot of things, but the stuff that's
       | baked into it already or can be enabled by some extensions is
       | simply amazing)
        
       | williamstein wrote:
       | I think one of the most important and interesting questions
       | regarding using pgvector is performance, and in particular, how
       | it compares to Qdrant, Weaviate, etc. This post hints at that
       | where it says "I presented a lightning talk called Vectors are
       | the new JSON where I shared use-cases and some upcoming
       | challenges with improving PostgreSQL and pgvector performance for
       | querying vector data. Some problems to tackle (many of which are
       | in progress!) involve adding more parallelism to pgvector, adding
       | support for indexing for vectors with more than 2,000 dimensions,
       | and leverage hardware acceleration where possible to speed up
       | calculations.". But the post doesn't give any numbers. I tried to
       | read the linked lightning talk, but it's on
       | https://www.slideshare.net/, which is a really weird website now
       | -- every few slides it tried to force me to watch a 30 second
       | commercial!?
        
         | hot_gril wrote:
         | I'm a big fan of Postgres, and my app backends are usually very
         | Postgres-heavy. But yeah, I don't get why you'd _want_ to use
         | Postgres for AI inference unless there 's some performance
         | reason.
        
       | MWil wrote:
       | Someone wants to get started in AI/ML today and they have
       | beginner-level understanding of Python/Javascript. Without any
       | further context, but a desire to learn AI/ML and building on what
       | they know should that person next look to: 1) learn PostgreSQL,
       | pgvector, and whenever the "new" comes 2) learn PyTorch,
       | TensorFlow in Python 3) learn TensorFlow.js Presume hobby-level
       | interest, not production-safe best practices - so I guess there
       | is that additional context
        
         | gorbypark wrote:
         | Most likely #2 would be the best bet for both hobby level and
         | above. You could do some fun stuff with Postgres and pgvector,
         | but you'll be "limited" to creating some embeddings with an
         | existing model, storing them in pgvector and again using that
         | to add context to an existing model (more or less).
         | 
         | #3 would limit you to running existing models in a browser.
         | 
         | Only #2 would allow you to actually understand and create new
         | meaningful models.
        
         | hot_gril wrote:
         | #2. Databases like Postgres are central to backend
         | applications, but for AI the real action is happening on those
         | tensor frameworks.
         | 
         | Honestly I can't see pgvector becoming a mainstream way of
         | running inference. I used pg cube for that on one project a
         | while ago. Yeah it worked, but even ignoring the performance
         | issues, the only reason we considered it was because of our
         | weird use case. We were also doing other funky stuff like large
         | sparse matrix math using just float8 cols, with parallelism (by
         | splitting one query into ~32).
        
       ___________________________________________________________________
       (page generated 2023-06-26 23:02 UTC)