The Buffer option as past of PostgreSQL and Active Record Explain can help to identify where we could potentially improve the PostgreSQL Query performance further and the PostgreSQL execution plan visualizer makes it easier to identify which part of the query is relatively more resource intensive
The above is a presentation used as part of giving a lightning talk given at Euruko 2024 which gives one a high level overview of how to use the above Buffer option and the PostgreSQL execution plan visualizer tool
The example syntax of how to use buffers options in Rails with Active Record explain is: `Company.includes(:owner).where(id: owning_companies_ids).explain(:analyze, :buffers) `
The Buffer option wasn't initially documented in Rails guides(when it was originally to rails) and I've attempted to add a PR here: https://github.com/rails/rails/pull/52893 to fix this so that it could be added to the Rails Guides for PostgreSQL: https://guides.rubyonrails.org/active_record_postgresql.html