Skip to content

Add activerecord-explain-analyze gem

Toon Claes requested to merge tc-db-explain-analyze into master

What does this MR do?

This gem allows you to get the EXPLAIN ANALYZE query plan, directly from the Rails console.

The gem is installed with require: false, but if it was loaded on launch, this would be it's memory load:

TOP: 145.3086 MiB
  rails/all: 22.4844 MiB
  ...
  activerecord-explain-analyze: 2.9648 MiB
    active_record/connection_adapters/postgresql_adapter: 2.9648 MiB
      pg: 2.9648 MiB
        pg_ext: 2.9648 MiB
  ...

When it's run with a PostgreSQL database, it runs EXPLAIN (ANALYZE COSTS VERBOSE BUFFERS), see https://github.com/6/activerecord-explain-analyze/blob/8b2b28bdc14dc390ead2ca0b69ad5c7201794b04/lib/activerecord-explain-analyze/postgresql_adapter.rb#L5

Edited by Toon Claes

Merge request reports