MySQL Forums
Forum List  »  Stored Procedures

Re: Where Clause Performance
Posted by: Peter Brawley
Date: September 19, 2014 03:38PM

> but if i were to string build the query in the app language, it isn't as fast and efficient as doing a SP isn't it?

MySQL SPs rarely improve query performance. If the app language is running on the same sever as the DB, the diff is miniscule at most. On a distant server, mebbe it cvould become significant, but if that's so, it may be time to move one of them.

> which is why i've moved all queries as SP and passing in parameters as required

Most query execution time goes to scanning tables & indexes and assembling the result, and there the SP rarely improves performance.

> but i just want to know if there would be another way to customly/dynmaicly write the WHERE clause as i have done in my example in 1st post

A rule of thumb: do it where it's most convenient and where you'll just have to write it once.

Options: ReplyQuote


Subject
Views
Written By
Posted
2373
September 17, 2014 09:10PM
1072
September 18, 2014 11:11AM
1049
September 18, 2014 04:55PM
968
September 18, 2014 08:01PM
Re: Where Clause Performance
1135
September 19, 2014 03:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.