Skip to content

Commit c7a9f9f

Browse files
authored
Merge pull request #1896 from yasslab/update810/active_record_postgresql
Draft: active_record_postgresql.mdの更新翻訳
2 parents cf6fff6 + 9c7baca commit c7a9f9f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

guides/source/ja/active_record_postgresql.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,4 +836,22 @@ Railsの`config.active_record.schema_format`を`:sql`に設定すると、`pg_du
836836

837837
```ruby
838838
ActiveRecord::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

0 commit comments

Comments
 (0)