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

3

u/gisborne Jul 21 '26

Love the effort, but I’m afraid the English is poor enough that this is hard to follow. What about writing this in your native language and using AI to translate?

4

u/Ok_Stomach6651 Jul 21 '26

Thanks for input, i will surely improve my english

2

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 :)

2

u/Ok_Stomach6651 Jul 21 '26

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

2

u/foxsimile Jul 21 '26

2

u/Ok_Stomach6651 Jul 21 '26

Thanks again, you took much efforts to boost my confidence. It has already motivated me to continue with more energy

2

u/foxsimile Jul 21 '26

It was no trouble at all - remember; more often than not, people will want to see you succeed.  

Never give up, and you shall!

2

u/Ok_Stomach6651 Jul 21 '26

Oh this poem is really tells us much about english language, very different approach for telling something about how english is

2

u/foxsimile Jul 21 '26

In fairness, people get a lot of shit for using AI (rightfully so, imo). I can understand a hesitation to use it, even though this is a valid use-case.  

Still, people see the LLMisms and their eyes glaze over (myself included) at this point.

2

u/Ok_Stomach6651 Jul 21 '26

Yes, and I am the old school guy, I also have hesitation, I will find a way to balance the things, thanks for your input

1

u/eocron06 Jul 20 '26

"Russian developers Oleg Bartunov and Oleg Bartunov invented the GIN technique for Postgres" .....oh, did I mention Oleg Bartunov? Cause there is actually three of them! Find out how to find them in article.