|
Hi to all .. I've written two different queries as follows First One Second One My function is follows FROM VEHICLE_TYPE VT WHERE VT.VEHICLE_TYPE_SNO = @VEHICLE_TYPE_SNO) END HERE I'VE TO KNOW PERFORMANCE WISE EITHER INNER JOIN IS BEST OR PREDEFINED FUNCTION IS BEST PLEASE HELP ME THANKS TO ALL..........
(comments are locked)
|
|
Inner Join. The function will be called for every row in VEHICLE_MASTER, whereas the join will be one operation that returns a set of data. Be aware that the execution plan may show that the function query is 'better', but this will be based on an assumption that the function is called once, returning one row.
(comments are locked)
|
|
To add to @kev riley's answer, you could rewrite your function to be a table value function, calling this using CROSS APPLY. This would perform just as fast as the inner join. You would change the code to return a table, keeping the select the same as you have now, so it is an easy modification to make.
(comments are locked)
|
|
If we compare between scalar value function and table function for requirement then table value function is good for performance point of view but for your requirement I go with join because any how through table value function also we are making join with main table then why not we directly join with main table. So for your requirement Inner join will be faster.
(comments are locked)
|

