PHP/SQL: ORDER BY or sort($array)?

后端 未结 6 1075
你的背包
你的背包 2020-12-19 05:36

Which do you think is faster in a PHP script:

$query = \"SELECT... FROM ... ORDER BY first_val\";

or

while($row = odbc_fet         


        
6条回答
  •  悲&欢浪女
    2020-12-19 05:55

    If the ordered field is indexed, I'd say probably the SQL query. If not, I'm not sure, but I can't imagine it will be overly noticeable either way unless you're dealing with an absurdly large number of rows.

提交回复
热议问题