Indexes

Indexing is a way of sorting a number of records on multiple fields.

Indexes are used to quickly locate data without having to search every row in a database table every time a database table is accessed. Indexes can be created using one or more columns of a database table, providing the basis for both rapid random lookups and efficient access of ordered records.

Primary: This creates an auto-incrementing integer for the primary id of the table.

GIN: is a special feature of the PostgreSQL database. GIN stands for Generalized Inverted Index. GIN is designed for handling cases where the items to be indexed are composite values, and the queries to be handled by the index need to search for element values that appear within the composite items. For example, the items could be documents, and the queries could be searches for documents containing specific words.

Create Index: This allows for custom Indexes to be created using any of the columns of the database. This can be done in an ascending or descending direction. The Index type has two options: Unique or Index. A Unique Index does the same but enforces uniqueness - like using an email on a user table.