‹ BackHN Continuity

Thread

RIP, vector database

397 points · 116 comments · razin

  1. gopalv · · focus · HN ↗
    > This write amplification is large enough that our efforts to tune indexing throughput have started to hit diminishing returns.

    > don't key on the ANN address. That is precisely the change turbopuffer v3 makes. As you can imagine, it is not a trivial change.

    This is a direct parallel to how Postgres and Mysql built indexes.

    Your design choice went from a Postgres design pattern to a Mysql one. The difference is the reindexing cost vs the lookup cost - Postgres optimized for lookup and Mysql does for indexing on writes. Or more accurately, Postgres was better with good schema design using joins & mysql was optimized for a bad design with less normalization where many indexes exist for the same table.

    Postgres always points an index to a row-id within postgres which is an arbitrary value which changes on each update.

    Mysql, always assuming the storage engine is pluggable, points to the primary index entry and adds an extra indirection to the lookup.

    This means that you point the mysql index to a stable id, so unless you go update the primary key for a row, you won't have to update the indexes for all the attribute lookups you might have made to data.

    I don't do databases any more that much, but the design for NIMBLE file format has a lot of quirks which are relevant to this specific idea (wide tables).

    But the old Uber post about switching from Postgres to Mysql to prevent index amplification[1] is a direct mirror to this post.

    [1] - <a href="https:&#x2F;&#x2F;www.uber.com&#x2F;us&#x2F;en&#x2F;blog&#x2F;postgres-to-mysql-migration&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.uber.com&#x2F;us&#x2F;en&#x2F;blog&#x2F;postgres-to-mysql-migration&#x2F;

    1. malisper · · focus · HN ↗
      &gt; Your design choice went from a Postgres design pattern to a Mysql one. The difference is the reindexing cost vs the lookup cost - Postgres optimized for lookup and Mysql does for indexing on writes. Or more accurately, Postgres was better with good schema design using joins &amp; mysql was optimized for a bad design with less normalization where many indexes exist for the same table

      You are right that MySQL does better when you have lots of indexes, but I don&#x27;t think the tradeoff is that the overall Postgres architecture is better with good schema design.

      Having secondary indexes point the primary key enables things like undo logging, which obviates the need for vacuums - vacuums being the most painful part of Postgres. On top of that your primary key index will be mostly cached so the cost of the indirection is much smaller than it may first appear

      1. throwaway7783 · · focus · HN ↗
        .. and undo logs make rollbacks and crash recoveries slower. It&#x27;s a trade off. MySQL storage engine architecture is nice, postgresql extension mechanism is nice.. and so on.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.