EasyUI Forum
May 14, 2024, 07:35:12 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: speed query execution  (Read 2989 times)
frankz
Newbie
*
Posts: 16


View Profile
« 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);

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!