Hacker News new | past | comments | ask | show | jobs | submit login

I remember when working with Oracle 20 years ago the DBA liked to make sidecar tables to hold the big columns, so they were out of the way of most queries. It was awkward but I guess it was worth it. One time after starting to use Postgres I almost did the same thing, but then I realized the database was already doing it for me. TOAST really is the greatest thing since sliced bread!

If you made it to the end of the article, you saw the author recommends to consider making these sidecar tables by hand if you have medium-size texts. I think I would try very hard to tune TOAST before going that far. Also note that changing the table storage parameters doesn't automatically re-write the existing data. You need to re-store the data to make that happen. I believe `UPDATE t SET foo = foo` would do it, but I haven't tested.

The 8kB page size also matters when you use Postgres as a vector database, e.g. with pgvector. Jonathan Katz gave a great lightning talk about this a few months ago at PGCon. Vectors these days can have a lot of parameters, so they are big. But since the whole point is to query against the vector, you don't really want it TOASTed. I believe he has been working on some tricks to solve that problem.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: