Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 599 Bytes

indexes.md

File metadata and controls

28 lines (19 loc) · 599 Bytes

Indexes

Index types

Postgres_ext allows you to specify index type and index operator class at index creation.

add_index :table_name, :column, :using => :gin
add_index :table_name, :column, :using => :gin, :index_opclass => :gin_trgm_ops

Where clauses

Postgres_ext allows you to specify a where clause at index creation.

add_index :table_name, :column, :where => 'column < 50'

Concurrent Indexes

Postgres_ext allows you to create indexes concurrently using the :algorithm option

add_index :table_name, :column, :algorithm => :concurrently