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.
This commit is contained in:
@@ -601,7 +601,8 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma
|
||||
$ret = '<option value=""></option>' . "\n";
|
||||
|
||||
$reloptions = array('content-id' => array(), 'id-content' => array());
|
||||
while ($relrow = @PMA_DBI_fetch_assoc($disp)) {
|
||||
|
||||
foreach($disp AS $disp_key => $relrow) {
|
||||
$key = $relrow[$foreign_field];
|
||||
if (strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) {
|
||||
$value = (($foreign_display != FALSE) ? htmlspecialchars($relrow[$foreign_display]) : '');
|
||||
|
Reference in New Issue
Block a user