Do it in mysql or an API language?

from the Artful MySQL Tips List


Generally speaking, within-row and row-to-row conputations are much faster in an API language (C, C++, C#, PHP, Python, Java) than in the MySQL layer---as this generally good Stack Overflow discussion says, "most DB platforms ... have very poor functionality for working with individual values." You could say the same for many a theta (non-equi-) join, which, for big datasets, PHP and other MySQL API languages can often compute from buffered rowsets in an order of magnitude less time than a Join in the database layer.

Return to the Artful MySQL Tips page