AllowPreparedStatement
Prepare a query statement before its execution.
Data Type
bool
Default Value
true
Remarks
Specifies whether, when the server executes SQL queries, those queries are passed onto the Oracle OCI database, which compiles the submitted SQL into more performant PL\SQL code before executing the query.
If this connection property is set to True, the server retains the compiled form of each query, and for any repeated executions of the query, the server, rather than submitting the query for compilation, submits this precompiled query, also known as a prepared statement.
This skips the compilation step entirely and the Oracle OCI database executes this precompiled code as-is. Avoiding recompiling the same query over and over can improve performance if you are executing the same queries several times.
Note that the server only retains prepared statements in memory for the duration of the current connection -- they will need to be compiled again to regain the performance benefit seen with repeatedly executed queries.
If this connection property is set to False, the server submits every query to Oracle OCI to be compiled before execution. This is useful if you are executing many unique queries once (rather than repeatedly executing the same queries).
If you are not going to execute the same queries multiple times, there is no benefit to holding precompiled queries in memory, and so disabling this connection property can save that memory and potentially improve performance in memory-limited scenarios.