Hi,
I have requirement to optimize a view. The structure of view is available as below with multiple select commands based on code.
SELECT `S`.`ID` AS `ID`,(select `TEST_MASTER_DATA`.`LABEL` from `TEST_MASTER_DATA` where ((`TEST_MASTER_DATA`.`CODE` = `S`.`CODE`) and (`TEST_MASTER_DATA`.`FIELD` = 5))) AS `STATUS_CODE`,
`S`.`INFO` AS `INFO`
FROM `Test_Sales` `S`LEFT JOIN `Test_FollowUp` `F` ON `S`.`ID`= `F`.`ID` ;
I have multiple select commands with in the view to fetch the label from master data based on the code since we are saving code in the sales table.
Since we are triggering multiple calls with reference data the view is taking too much time in the user interface level.
Is there any way to optimize the view to improve the performance.
Thanks in Advance
Discussion posts and replies are publicly visible
indexing, where ? in view?
if you can't implement the above way then we can optimize the view itself. May be the chances that we can rearrange the view for better performance.
you can also refer the below link : it has some very good suggestion to optimize the query.Cross check with your query may be you will find some way to improve your query.
https://www.safaribooksonline.com/library/view/high-performance-mysql/9780596101718/ch04.html
https://dev.mysql.com/doc/refman/8.0/en/view-restrictions.html
If you face the problem then we need query to examine.
Regards
Abhay Giri