How can I build faster queries with MySQL that use user-defined functions?
-
I've been added four user-defined functions that receive a parameter, they search these data into four tables an returns some other data (strings). This functions are used as regular columns at simple queries. The problem is when load a lot of records, i suppose that each record runs the four functions without caching data and the results are so slow (8,000 records in 7 secs). My main concern is the performance. Exist some way to debug a query instead of EXPLAIN command..?
-
Answer:
Well, EXPLAIN is how you can find out how the query will run, but you can make your UDF a procedure and make it spit out to the console "EXPLAIN" commands on the SQL you're running so that you can see what's happening with each query that runs.
Joe Emison at Quora Visit the source
Related Q & A:
- How can I make Private Messages in Drupal 7 with user user pictures like in Facebook?Best solution by Drupal Answers
- How can I get faster in the 100m?Best solution by Yahoo! Answers
- How can I run faster?Best solution by Yahoo! Answers
- How can I read faster while comprehending?Best solution by wikihow.com
- How can I advance faster in figure skating?Best solution by figureskating.about.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.