Project

General

Profile

Actions

Feature #9745

open

Dbo: LRU prepared statement cache

Added by Roel Standaert over 3 years ago. Updated about 7 hours ago.

Status:
Review
Priority:
Normal
Assignee:
-
Target version:
Start date:
02/14/2022
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Romain Mardulyn 3 days ago

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn
Actions #2

Updated by Romain Mardulyn about 7 hours ago

  • Status changed from InProgress to Review
  • Assignee deleted (Romain Mardulyn)
Actions

Also available in: Atom PDF