Is php or sql faster for basic operations

I wanted to know that when this parameter is set, is it faster to process using php or mysql? For example, let's say that I want to combine two values ​​from two columns, if I do

SELECT col1,col2 FROM table WHERE conditions

And then combine in php

or should i do

SELECT CONCAT(col1,col2) as concatenated FROM table WHERE conditions

and then no need to concatenate?

Another example could be the size limit of returned rows, which can be done in sql using LEFT or php using substr

If they have the same speed, then what is the preferred method?

I am using the latest xampp on a windows 7 machine.

+5
source share
2 answers

. , , ( ).

+11
  • , .
  • , 2 ( , php)

, , , , - , . PHP , , , PHP , .

; , , , .

+2

All Articles