Postgres Indexes for ActiveRecord Join Tables in Rails Apps

Join tables are a common citizen in Ruby on Rails apps. Their use case is to provide many to many relation between database models. Adding correct Postgres indexes on join tables is not obvious. I’ve noticed that some tutorials, Stack Overflow posts, and even Rails itself provide incorrect advice on how to do it. In this tutorial, we’ll look into how compound PostgreSQL indexes work and how to correctly use them with join tables.
Postgres Indexes for ActiveRecord Join Tables in Rails Apps #ruby #rubydeveloper #rubyonrails #activerecord https://rubyonrails.ba/single/postgres-indexes-for-activerecord-join-tables-in-rails-apps

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles