I've heard many times that you can write your own functions in MySQL (in order to bypass large bulkheads in PHP). I read the manuals and did not understand. You can not write your function without using third-party resources? Those. in any case, will you have to either compile with your sources ... or connect the library?
It is possible in more detail, who faced it? And how much it can be more effective than a bulkhead using PHP. ')
PS .: I ask a lot of questions here of a different nature, because at work to understand the manual, unfortunately there is no time. Therefore, I ask for help.
PPS: I have a recursive function on pkhp, which goes along the goods branch (id: 145 -> (goods) -> id: 156 (subsidiary 145'go) -> goods-> etc.)
It is necessary to make a sample, therefore I consider that it will not be expedient for PHP.