From c5e083af3ddbad1829c3b52ac0cd8520b759c7b5 Mon Sep 17 00:00:00 2001 From: schneems Date: Tue, 15 Apr 2014 13:06:20 -0500 Subject: [PATCH] [ci skip] document `statement_limit` Per discussion at https://github.com/rails/rails/issues/14645#issuecomment-40499409 --- guides/source/configuring.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 873993f610..b17c24363b 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -646,7 +646,7 @@ development: pool: 5 ``` -Prepared Statements can be disabled thus: +Prepared Statements are enabled by default on PostgreSQL. You can be disable prepared statements by setting `prepared_statements` to `false`: ```yaml production: @@ -654,6 +654,16 @@ production: prepared_statements: false ``` +If enabled, Active Record will create up to `1000` prepared statements per database connection by default. To modify this behavior you can set `statement_limit` to a different value: + +``` +production: + adapter: postgresql + statement_limit: 200 +``` + +The more prepared statements in use: the more memory your database will require. If your PostgreSQL database is hitting memory limits, try lowering `statement_limit` or disabling prepared statements. + #### Configuring an SQLite3 Database for JRuby Platform If you choose to use SQLite3 and are using JRuby, your `config/database.yml` will look a little different. Here's the development section: -- GitLab