Postgres Indexes for ActiveRecord Join Tables in Rails Apps
25-Jun-2020 1713
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 #Postgres #Indexes #ActiveRecord #Tables #Rails #activerecord https://rubyonrails.ba/link/postgres-indexes-for-activerecord-join-tables-in-rails-apps