Skip to content
Commit 2583fd2a authored by Felix Oertel's avatar Felix Oertel Committed by Wouter Wolters
Browse files

[TASK] Use queryCache in generic persistence

At the moment extbase persistence is quite slow. To some degree,
the query building is responsible for that. For each and every
query the parseQuery() and buildQuery() methods are called.

This patch introduces a query cache to store the query structure.
This way a query can be reused, even when fired with different
parameters.

* Introduce a parameterIdentifier to the comparison
	In the way the extbase query object model works, it's hard to
	identify an object in a way which is unique and still compre-
	hensible. To ease this, an identifier is introduced.

* Move parsing to an external QueryParser
	All the query parsing is now seperated from the storageBackend.
	The query parsing is mostly left the way it was, it should be
	re-profiled later.

* introduce cache extbase_typo3dbbackend_queries

* No more statement handling by reference
	Make getStatementParts() return the query and parameters in an
	array instead of handing down the parameters by reference.

* Split up parseQuery in preparsing and real parsing with caching
	In every call the query has to be preparsed to determine the
	identifier and extract the parameters. The identifier can then
	be used to look up the query structure in the cache. If it is
	not (yet) cached, Extbase will do the real parsing which takes
	some more time.

* Introduce useQueryCache to querySettings
	Like preparedStatements, caching the queries does not always
	make sense and will spam your cache under certain conditions.
	It's enabled by default and can be disabled on a per-query-
	basis.

* Use named parameter's placeholders
	Instead of using "?" as parameter's placeholder and relying
	on the right order of parameters in the array, named place-
	holders are used to ensure the correct association.

* Move unit tests around to fit the new queryParser

Resolves: #55167
Releases: 6.2
Change-Id: I517c0500cad75cae96fd739f2ff7222db80b42a5
Reviewed-on: https://review.typo3.org/27555
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Tested-by: Philipp Gampe
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
parent 69b05b7f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment