How to optimize performance and speed up loading data from database?
I have a database table cars
that has close to 500k records. I was facing issues with long loading times to load data from this table.
Rails 7 + PostgreSQL: How to optimize performance and speed up loading data from database?
I have a database table cars
that has close to 500k records. I was facing issues with long loading times to load data from this table.
Rails Active Record query joins and merge get Ids
User -> Has many cats Vaccinations -> has many cats Cat -> Belongs to vaccination This is what I have tried so far User::CatRecords.joins(cat: :vaccinations).merge(Cat.vaccinated) What I am trying to achieve is get ids of all the cats in the query above. How can I do it? TIA ruby-on-rails postgresql activerecord