r/programming • • Sep 24 '20

PostgreSQL 13 Released!

https://www.postgresql.org/about/news/2077/
1.3k Upvotes

236 comments sorted by

View all comments

289

u/little_blue_teapot Sep 24 '20

The major highlights:

PostgreSQL 13 contains many new features and enhancements, including:

  • Space savings and performance gains from de-duplication of B-tree index entries

  • Improved performance for queries that use aggregates or partitioned tables

  • Better query planning when using extended statistics

  • Parallelized vacuuming of indexes

  • Incremental sorting

51

u/I_AM_GODDAMN_BATMAN Sep 24 '20

I'm curious about reverse b-tree index to support LIKE '%something' query. Maybe it's better to use GIN.

28

u/Tavi2k Sep 24 '20

You probably could define an index on reverse(column) for that, then the wildcard is at the end of the string again and a B-tree index works. That index won't be good for anything else, though.

A heavier option is a trigram index, that should be able to speed up this kind of query as well.

4

u/sbrick89 Sep 25 '20

Usually for those full search capabilities, inverted indexes are the structure of choice. Sadly those systems essentially try to break text into words, so certain code / numbering convention type of situations get fucked.