From the course: Advanced SQL for Data Scientists

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

GIN and BRIN indexes

GIN and BRIN indexes

From the course: Advanced SQL for Data Scientists

Start my 1-month free trial

GIN and BRIN indexes

- [Instructor] One of the reasons I like working with Postgres is that it has specialized indexes for data types that are more complex than we typically work with. So for example, there's something called a GIN index which stands for generalized inverted index. And that's used when we have to index data that are inside other elements or other pieces of data. And we call these things composite values and we use a GIN index when we need to index the values which are in that composite item. So for example, words in a document, the composite data structure is the document, but in that document, each of those words is a individual element, which we are interested in indexing. Now the index stores the data and key value pairs and the key is the element value and the posting list is a set of row IDs where that key occurs. So it's very fast to go from key to actual data location. Now GIN index has a large number of built-in…

Contents