[英]Maximum allowed PHP-Postgres prepared statements?
是否可以使用PHP的pg_prepare()函数准备的预准备语句数量有限制吗?
There is not a numerical maximum number of PREPARE
ed statements, there is a logical limit in the amount of RAM that a backend can allocate, however. 但是,没有数字最大数量的PREPARE
ed语句,但后端可以分配的RAM量存在逻辑限制。 As long as the PREPARE
succeeds, the PostgreSQL backend will save the prepared statement until the connection drops, at which point it will clean up the PREPARE
ed statements (or you could DEALLOCATE
the PREPARE
ed statement when you want to free up the memory). 只要PREPARE
成功,PostgreSQL后端将保存准备好的语句,直到连接断开,此时它将清理PREPARE
ed语句(或者当你想释放内存时可以DEALLOCATE
PREPARE
ed语句)。
All PREPARED
statements are stored in a per-backend hash table. 所有PREPARED
语句都存储在每个后端哈希表中。 Memory allocation for the PREPARE
ed statement is handled by the statement itself and is reassigned to the prepared statement cache. PREPARE
ed语句的内存分配由语句本身处理,并重新分配给预准备语句高速缓存。 See src/backend/commands/prepare.c
and src/backend/utils/cache/plancache.c
:SaveCachedPlan() if you're curious about the details. 如果您对细节感到好奇,请参阅src/backend/commands/prepare.c
和src/backend/utils/cache/plancache.c
:SaveCachedPlan()。
This information is current as of 2012-01-03 for PostgreSQL 9.1+ and may be different in the future when PostgreSQL supports a durable cache of PREPARE
ed statements. 此信息是2012-01-03 PostgreSQL 9.1+的最新信息,将来PostgreSQL支持PREPARE
ed语句的持久缓存时可能会有所不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.