Feature #9745
openDbo: LRU prepared statement cache
0%
Description
We currently have a prepared statement cache for every database connection. We do a string-based lookup to see if we already have a prepared statement in the cache, and otherwise we add a new prepared statement.
If we have more uses of the same prepared statement we add extra copies to the cache.
We however don't ever remove prepared statements from the cache, except for completely emptying the cache on a reconnect. This means that we may keep accruing prepared statements, especially if string concatenation is used to create queries (which we of course don't want to do, we want to bind parameters, but sometimes it may not be avoidable). This may cause us to waste memory on the database server side as well.
We could consider adding a configurable maximum of prepared statements, and discard those that were least recently used.
RM Updated by Romain Mardulyn about 1 year ago
- Status changed from New to InProgress
- Assignee set to Romain Mardulyn
RM Updated by Romain Mardulyn about 1 year ago
- Status changed from InProgress to Review
- Assignee deleted (
Romain Mardulyn)
RM Updated by Romain Mardulyn 10 days ago
- Target version changed from future to 4.15.0
ED Updated by emil de keyser 7 days ago
- Assignee set to emil de keyser