The Bullet gem is designed to help you increase your application’s performance by reducing the number of queries it makes.

It will watch your queries while you develop your application and notify you when

a) when you should add eager loading (N+1 queries),

b) when you’re using eager loading that isn’t necessary and

c) when you should use counter cache.

Follow this link to read more -