Project

General

Profile

Actions

Improvements #14637

open

Allow removal of prepared statements to limit memory usage and prevent exhaustion of prepared statements

Added by Dries Mys 17 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/01/2026
Due date:
% Done:

0%

Estimated time:

Description

Wt::Dbo stores a prepared statement forever once it is executed a single time.

Most of the time, one could limit the number prepared statements by using parameter binding.

However, when the query is dynamically generated based on optional conditions, joins, sub queries and/or IN statements, the number of prepared statements may become very large due to the exponentially increasing number of possible combinations. Possibly exhausting all available prepared statements in the database engine or substantially increasing memory usage. Storing the prepared statement is often useless in this case as each specific query will be rarely used.

Therefore, it would be useful if one could remove a prepared statement and/or specify that the prepared statement should be automatically removed when a specific Call or Query/Collection instance is destructed.

Another alternative may be to limit the maximum number of prepared statements and deleting a prepared statement (e.g. based on usage statistics) once the limit is reached.

No data to display

Actions

Also available in: Atom PDF