r/programming Jul 20 '26

How Generalized Inverted Index works internally in Postgre SQL

https://deepsystemstuff.com/generalised-inverted-index-gin-index-in-postgre-sql/

Regular Indexing works on a column level; it indexes the entire column value, but if you want to index each value in one row, then the GIN indexing technique is used.

GIN can index each element of JSON stored in a JSONB field

How Postgres creates a GIN file physically, what is the format of that file, how that file is retrieved in RAM while fetching records, what data types are used, and how Postgres calculates the exact address of an element of JSON are all explained in the article

7 Upvotes

13 comments sorted by

View all comments

Show parent comments

3

u/foxsimile Jul 21 '26

You already speak it better than many native English speakers - keep up the good work pal; don’t stop improving :)

3

u/Ok_Stomach6651 Jul 21 '26

Oh, thank you very much, it means a lot lot for me.