Performance function alias

The following two words which sentence performance better? Why?
select * from table
Where func (field 1, field 2, field 3)>0
Order by func (field 1, field 2, field 3) desc


select * from (
  select t.*,Func (field 1, field 2, field 3) as alias
  from table
)
The where alias>0
Order by alias desc


Func is a write function, please tell us the reason, don't just say what or like, thank you

Started by Tess at December 02, 2016 - 2:05 AM

The first, less a query, speed must be fast. Look at the proposal of implementation plan

Posted by Marshall at December 07, 2016 - 2:41 AM

The statement is certainly a better.
But you this SQL to specific analysis, such as your function.
Look at the execution plan stick out a mile.

Posted by Fannie at December 22, 2016 - 2:57 AM

The execution plan to test not to know.

Posted by Donna at December 25, 2016 - 3:22 AM