[CONPY-10] Implement prepare caching Created: 2018-07-24  Updated: 2018-07-26

Status: Open
Project: MariaDB Connector/Python
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Diego Dupin Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Implementation can reuse a prepared statement on cursor level if the query is strictly the same than the previous one.

MariaDB saves the prepared statement at the Connection level. The connector must work accordingly, saving X prepared result at connection level in an LRU cache, then prepare only if not in this LRU cache.



 Comments   
Comment by Georg Richter [ 2018-07-25 ]

Do I miss something? This is already implemented in MrdbCursor_isprepared()

Comment by Diego Dupin [ 2018-07-25 ]

If I'm not wrong :

  • that is on cursor level. that means that if creating 1 cursor and closing it, next cursor will reprepare query.
  • That cache will only cache the last prepared command. If querying A then B then A, A will be reprepare
Comment by Georg Richter [ 2018-07-26 ]

Yes, currently it's cached by cursor not by connection.
Afaik a prepared statement cache should be part of Connector/C, not python. It would be a useful feature also for ODBC.

Generated at Thu Feb 08 03:29:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.