mysql resultset is very slow in php output -
i have query 4000 rows in resultset. if execute query in query browser heidisql 4000 lines in 0.5 seconds. if make print_r($result);
view inside internet browser, datas in 30 seconds. big difference! have tried mysqli , pdo same problem. simple query twotable (with left join) 18 columns. have in query , criterias indexed (2 index!) have mysql 5.1 php 5.3
here code:
$db_handle->setattribute(pdo::attr_errmode, pdo::errmode_exception); $db_handle->setattribute(pdo::attr_autocommit, false); $time_start = microtime(true); $sqlcff = " select .... "; $result_set = $db_handle->query($sqlcff); $result = $result_set -> fetchall(); print_r ($result); $time_end = microtime(true); $time_res = $time_end - $time_start;
here result explain:
1 simple f range center center 20 51000 using index condition; using where; using mrr 1 simple g ref compte compte 62 func 1 using
if has idea figure out more fast output in php?
thx in advance
using explain
explain select * tablename
understanding explain’s output
id: 1 select_type: simple table: categories type: possible_keys: null key: null key_len: null ref: null rows: 4 extra: 1 row in set (0.00 sec)
Comments
Post a Comment