Project

General

Profile

Actions

Feature #9745

open
RS ED

Dbo: LRU prepared statement cache

Feature #9745: Dbo: LRU prepared statement cache

Added by Roel Standaert over 4 years ago. Updated 7 days ago.

Status:
Review
Priority:
Normal
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.

RM Updated by Romain Mardulyn about 1 year ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn

RM Updated by Romain Mardulyn about 1 year ago Actions #2

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

RM Updated by Romain Mardulyn 10 days ago Actions #3

  • Target version changed from future to 4.15.0

ED Updated by emil de keyser 7 days ago Actions #4

  • Assignee set to emil de keyser
Actions

Also available in: PDF Atom