Commit 9c0fe1ed authored by Victor Emanouilov's avatar Victor Emanouilov

[FIX] remove unnecessary join to tiki_tracker_fields and add an important...

[FIX] remove unnecessary join to tiki_tracker_fields and add an important missing where clause matching itemIds of tiki_tracker_items and tiki_tracker_item_fields - drastically reduces the execution speed of get_all_item_id
parent 71de5c56
Pipeline #71737619 passed with stages
in 88 minutes and 46 seconds
......@@ -452,8 +452,8 @@ class TrackerLib extends TikiLib
function get_all_item_id($trackerId, $fieldId, $value)
{
$query = "select distinct ttif.`itemId` from `tiki_tracker_items` tti, `tiki_tracker_fields` ttf, `tiki_tracker_item_fields` ttif ";
$query .= " where tti.`trackerId`=ttf.`trackerId` and ttif.`fieldId`=ttf.`fieldId` and ttf.`trackerId`=? and ttf.`fieldId`=? ";
$query = "select distinct ttif.`itemId` from `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif ";
$query .= " where tti.`itemId`=ttif.`itemId` and tti.`trackerId`=? and ttif.`fieldId`=? ";
$value = "%$value%";
$query .= " and ttif.`value` LIKE ?";
......
Markdown is supported
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