What is the basic principle in optimizing queries reg. activerecords? I’ve got orders which are related to orderdetails, products, rawmaterials etc. which are linked with the order-id. The more rows there are in the index-view, the slower it gets. Each row in index-view takes some millisecond since the relation is defined in the model class and when using the relation the SQL is executed (as you know). Any low hanging fruits in this case? Thanks.