Skip to content
Snippets Groups Projects
Commit ef0b5809 authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

search: Fix double full-text searching

When using a nested query to perform the search for the ticket queue, drop the extra
full-text search criteria join from the outer query. This seems to drop the
`rows_examined` by a factor of two and drops the query time by an order of
magnitude.
parent 2ab505d6
Branches
Tags
No related merge requests found
......@@ -82,7 +82,7 @@ $tickets = $pageNav->paginateSimple($tickets);
// criteria, sort, limit, and offset from the outer query.
$criteria = clone $tickets;
$criteria->annotations = $criteria->related = $criteria->aggregated = [];
$tickets->constraints = [];
$tickets->constraints = $tickets->extra['tables'] = [];
$tickets = $tickets->filter(['ticket_id__in' => $criteria->values_flat('ticket_id')])
->limit(false)->offset(false)->order_by(false);
# Index hint should be used on the $criteria query only
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment