File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -836,4 +836,22 @@ Railsの`config.active_record.schema_format`を`:sql`に設定すると、`pg_du
836836
837837``` ruby
838838ActiveRecord ::Tasks ::DatabaseTasks .structure_dump_flags = [" --no-comments" ]
839- ```
839+ ```
840+
841+ Explain
842+ -------
843+
844+ 標準の[ ` explain ` ] [ explain-options ] オプションに加えて、PostgreSQLアダプタは[ ` buffers ` ] [ explain-analayze-buffers ] もサポートしています。
845+
846+ ``` ruby
847+ Company .where(id: owning_companies_ids).explain(:analyze , :buffers )
848+ # => EXPLAIN (ANALYZE, BUFFERS) SELECT "companies".* FROM "companies"
849+ # ...
850+ # Seq Scan on companies (cost=0.00..2.21 rows=3 width=64)
851+ # ...
852+ ```
853+
854+ 詳しくはPostgreSQLのドキュメントを参照してください。
855+
856+ [ explain-options ] : active_record_querying.html#explainのオプション
857+ [ explain-analayze-buffers ] : https://www.postgresql.jp/document/17/html/sql-explain.html
You can’t perform that action at this time.
0 commit comments