EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: frankz on November 28, 2016, 02:12:13 AM



Title: speed query execution
Post by: frankz on November 28, 2016, 02:12:13 AM
it is possible that the execute bit of a query (select) with 2 fields and the same with 8 fields (1000 records), the page load times with datagrid (url: file.php) range from 3 seconds to 30 seconds?
Code:
$sql = "SELECT idCliente,cognome,nome,codFisc,via,tel,telCell,note
FROM clienti ORDER BY idCliente DESC ";
try {
    $stmt = $DB->prepare($sql);
    $stmt->execute();
    $results = $stmt->fetchAll();
} catch (Exception $ex) {
    printErrorMessage($ex->getMessage());
}
$returnArray = array();
if (count($results) > 0) {
foreach ($results as $rs) {
$returnArray[] = $rs;
}
}
echo json_encode($returnArray);