diff options
author | schneems <richard.schneeman@gmail.com> | 2014-04-15 13:06:20 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2014-04-15 13:06:26 -0500 |
commit | c5e083af3ddbad1829c3b52ac0cd8520b759c7b5 (patch) | |
tree | 70c0d66dc902179573c7ac4889bb8c14db551a3f /guides | |
parent | b415390ad666999c7b01ca6a29ce453a8dbe2ac2 (diff) | |
download | rails-c5e083af3ddbad1829c3b52ac0cd8520b759c7b5.tar.gz rails-c5e083af3ddbad1829c3b52ac0cd8520b759c7b5.tar.bz2 rails-c5e083af3ddbad1829c3b52ac0cd8520b759c7b5.zip |
[ci skip] document `statement_limit`
Per discussion at https://github.com/rails/rails/issues/14645#issuecomment-40499409
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/configuring.md | 12 |
1 files changed, 11 insertions, 1 deletions
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: |