The Surprising Impact of Medium-Size Texts on PostgreSQL Performance (2020)

Any database schema contains text fields that can be divided into three categories: small texts, large texts, and medium texts. In this article, the impact of medium-size texts on query performance in PostgreSQL is explored. The PostgreSQL database handles large chunks of text using a technique called TOAST (the best thing since sliced bread), which compresses and/or breaks up large field values into multiple physical rows stored in a separate TOAST table. The article demonstrates the usage and effects of TOAST on query performance. The surprising finding is that querying a large table with TOAST can be faster than querying a medium-sized table.

https://hakibenita.com/sql-medium-text-performance

To top