From b8df10e41e10dba9bc6b3754a654a339676e9abd Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Wed, 28 Jan 2004 11:23:38 +0000 Subject: Get rid of mysql_data_seek(). Use pre-cached PHP array for mysqli compatibility and bandwidth saving. Memory issues by caching should not arise, as the used cache will (in our previously used cases) only cache index fields and max. 200 relation rows. I tested performance on my machine: By fetching 400kb of data twice via mysql_fetch_row() -> mysql_data_seek() -> mysql_fetch_row() this was performed in 0.25 seconds. By fetching it once and caching in a PHP array via mysql_fetch_row -> foreach this is performed in 0.32 seconds. With usual data as used in PMA (10kb) I could only detect a performance change of 0.009 seconds, which is respectable I think. By not using mysql_data_seek we are later able to use global mysqli USE_RESULT options to fetch rows singly. I discussed that yesterday with Rabus, and if there are any objections we can surely discuss that further on the list. --- browse_foreigners.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'browse_foreigners.php') diff --git a/browse_foreigners.php b/browse_foreigners.php index e7e1c0fd7c..7d032a37bd 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -138,7 +138,7 @@ $header = ' echo $header; -if (isset($disp) && $disp) { +if (isset($disp_row) && is_array($disp_row)) { function dimsort($arrayA, $arrayB) { $keyA = key($arrayA); $keyB = key($arrayB); @@ -153,7 +153,7 @@ if (isset($disp) && $disp) { $mysql_key_relrow = array(); $mysql_val_relrow = array(); $count = 0; - while ($relrow = @PMA_DBI_fetch_assoc($disp)) { + foreach($disp_row AS $disp_row_key => $relrow) { if ($foreign_display != FALSE) { $val = $relrow[$foreign_display]; } else { -- cgit v1.2.3