The queries are cached with the needle.
Example: SELECT DBServer FROM DBServer AS DBServer WHERE 1 AND MATCHES \'db1\'
As a consequence, each a global search is issued, the cache grows by approx. 70 queries !!!
suggested fix:
ExpressionMatch(needle, class = '')
oFilter->AddCondition_FullText()
with oFilter->SetCondition(new ExpressionMatch(...))
DBObjectSearch::...FullText...()
verbs
Fixed in trunk [r4959]
The implementation is much simpler than the one originaly proposed: the method AddCondition_FullText become a wrapper for AddConditionExpression(Expression::FromOQL('CONCAT(......) LIKE CONCAT("%", :needle, "%")))
Related
Commit: <Commit _id='5358055aa02bb175d1406271:4959' tree_id='d2ccbc1af565072055b091c3fdd83a2cbcc9fc49' committed=I{'date': datetime.datetime(2017, 10, 3, 11, 35, 21, 43000), 'email': '', 'name': 'romainq'} authored=I{'date': datetime.datetime(2017, 10, 3, 11, 35, 21, 43000), 'email': '', 'name': 'romainq'} message='N.1065 and #372 Query build cache not efficient with global search (each search generates about 80 new entries in the APCu cache)' parent_ids=I['5358055aa02bb175d1406271:4958'] child_ids=I['5358055aa02bb175d1406271:4960'] repo_ids=I[ObjectId('5358055aa02bb175d1406271')]>
Last edit: Romain Quetiez 2017-10-03
Diff:
Still, when displaying search results, the cache is growing with queries in the form 'SELECT Person WHERE id IN(123, 546)'... to be continued