-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adjust ticket-search to support search via Lens Dynamic Fields #3789
Comments
re performance: example EXPLAIN PLan for the generated SQL of a Lens query MariaDB [otobo]> explain SELECT DISTINCT st.id, st.tn, st.create_time FROM ticket st INNER JOIN dynamic_field_value lensdfv1 ON ( st.id = lensdfv1.object_id AND lensdfv1.field_id = 4 ) INNER JOIN dynamic_field_value dfv1 ON ( lensdfv1.value_int = dfv1 .object_id AND dfv1.field_id = 3 ) WHERE 1=1 AND (((dfv1.value_text LIKE 'TheSimple%' ) )) ORDER BY st.create_time DESC;
+------+-------------+----------+--------+---------------------------------------------------------------------------------------------------------------------------------+---------------------------------+---------+----------------------------+------+---------------------------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+----------+--------+---------------------------------------------------------------------------------------------------------------------------------+---------------------------------+---------+----------------------------+------+---------------------------------------------------------------------+
| 1 | SIMPLE | dfv1 | range | dynamic_field_value_field_values,dynamic_field_value_search_date,dynamic_field_value_search_int,dynamic_field_value_search_text | dynamic_field_value_search_text | 607 | NULL | 1 | Using index condition; Using where; Using temporary; Using filesort |
| 1 | SIMPLE | lensdfv1 | ref | dynamic_field_value_field_values,dynamic_field_value_search_date,dynamic_field_value_search_int,dynamic_field_value_search_text | dynamic_field_value_search_int | 13 | const,otobo.dfv1.object_id | 1 | |
| 1 | SIMPLE | st | eq_ref | PRIMARY | PRIMARY | 8 | otobo.lensdfv1.object_id | 1 | |
+------+-------------+----------+--------+---------------------------------------------------------------------------------------------------------------------------------+---------------------------------+---------+----------------------------+------+---------------------------------------------------------------------+
3 rows in set (0.001 sec) for comparison, EXPLAIN PLAN for a Simple DF search for a Dynamic Text Field (no Lens): MariaDB [otobo]> explain SELECT DISTINCT st.id, st.tn, st.create_time FROM ticket st INNER JOIN dynamic_field_value dfv1 ON (st.id = dfv1.object_id AND dfv1.field_id = 3) WHERE 1=1 AND (((dfv1.value_text LIKE 'TheSimple%' ) )) ORDER BY st.create_time DESC;
+------+-------------+-------+--------+---------------------------------------------------------------------------------------------------------------------------------+---------------------------------+---------+----------------------+------+---------------------------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------+--------+---------------------------------------------------------------------------------------------------------------------------------+---------------------------------+---------+----------------------+------+---------------------------------------------------------------------+
| 1 | SIMPLE | dfv1 | range | dynamic_field_value_field_values,dynamic_field_value_search_date,dynamic_field_value_search_int,dynamic_field_value_search_text | dynamic_field_value_search_text | 607 | NULL | 1 | Using index condition; Using where; Using temporary; Using filesort |
| 1 | SIMPLE | st | eq_ref | PRIMARY | PRIMARY | 8 | otobo.dfv1.object_id | 1 | |
+------+-------------+-------+--------+---------------------------------------------------------------------------------------------------------------------------------+---------------------------------+---------+----------------------+------+---------------------------------------------------------------------+
2 rows in set (0.001 sec) Apparently the costly operation is in Line 1 both times, and that is exactly the same. The only overhead introduced for Lens search is the extra Line which implements the "indirection reference" behavior of Lens which goes directly to the dynamic_field_value_search_int index. Looking at this, I would not try to improve performance at this point? |
- "Minimal invasive" changes to TicketSearch.pm - Add missing implementation to Lens.pm Driver - Add unit test for Lens searches
…rchFieldRender - adds support to render the proper Form Input type depending on referenced Attribute on the TicketSearch Screen
…sing Lens functionality add de-referencing and indirecting to attribute DF for - sub SearchFieldValueGet - sub SearchFieldParameterBuild - sub SearchFieldPreferences SearchFieldPreferences was completely absent in the Lens impl, falling back to the base implementation. That would prevent composite input fields (like Date) not to be displayed in TicketSearch form when added as additional filter.
- "Minimal invasive" changes to TicketSearch.pm - Add missing implementation to Lens.pm Driver - Add unit test for Lens searches
…rchFieldRender - adds support to render the proper Form Input type depending on referenced Attribute on the TicketSearch Screen
…sing Lens functionality add de-referencing and indirecting to attribute DF for - sub SearchFieldValueGet - sub SearchFieldParameterBuild - sub SearchFieldPreferences SearchFieldPreferences was completely absent in the Lens impl, falling back to the base implementation. That would prevent composite input fields (like Date) not to be displayed in TicketSearch form when added as additional filter.
Since the PR is merged, can this issue be closed? |
Implement the missing functionality in TicketSearch to support search via Lens DF
Test scenario:
When searching for a value of a Lens field, the search should return all Tickets where the value is referenced. So we want to find the referencing tickets, not the referenced ticket. In this test scenario, when searching for value, we want to find Ticket B, not Ticket A - if we wanted to find Ticket A, we could have just used a search for Text DF = value, omitting to search via Lens at all.
According to Sven it would be nice to accomplish this with "minimal invasive changes" to existing ticket search without sacrificing performance.
The text was updated successfully, but these errors were encountered: