performance - mysql slow speed simple query -
i have simple sql query select * "table name"
have not indexed table or else special.
the problem when execute through phpmyadmin
, query takes 0.003 seconds when execute through browser in web site takes 3 minutes!
there 20k rows in table , 19 fields. can help me?
include "config.php"; //connect database $query= mysql_query("select * table_name"); $num_rsl=mysql_num_rows($query); echo '<table border="1">'; for($i=0; $i <$num_rsl; $i++) { echo '<tr>'; $row=mysql_fetch_assoc($query); echo '<td>'.$row['id'].'</td>'; echo '<td>'.$row['idleistung'].'</td>'; echo '<td>'.$row['dtean'].'</td>'; echo '<td>'.$row['dtreifenbreite'].'</td>'; echo '<td>'.$row['dtreifenquerschnitt'].'</td>'; echo '<td>'.$row['dtreifenbauart'].'</td>'; echo '<td>'.$row['dtreifentragfahigkeit'].'</td>'; echo '<td>'.$row['dtreifengeschwindigkeitsindex'].'</td>'; echo '<td>'.$row['dtreifentttl'].'</td>'; echo '<td>'.$row['dtreifenprofil'].'</td>'; echo '<td>'.$row['dthersteller'].'</td>'; echo '<td>'.$row['dtbestand'].'</td>'; echo '<td>'.$row['fzg'].'</td>'; echo '<td>'.$row['dteinsatzzweck'].'</td>'; echo '<td>'.$row['dtartikelnr'].'</td>'; echo '<td>'.$row['dtbeschreibung'].'</td>'; echo '<td>'.$row['dtartikelnra2'].'</td>'; echo '<td>'.$row['dtfremdvkpreis'].'</td>'; echo '</tr>'; } echo '</table>';
usually, phpmyadmin modifies queries issue through mysql limit number of rows in result set.
select * table_name
most gets changed phpmyadmin to
select * table_name limit 0, 30
pulling 30 rows takes less time pulling rows.
@scones mentioned in comments: pulling 20k rows table, turning them big old html table, , sending them on wire browser takes lot of elapsed time. elapsed time determined performance of web server (where php runs) , wire between server , browser.
mysql performance
No comments:
Post a Comment