0
根據該文件在mysqli_use_resultmysqli_use_result()和併發
一個如果進行了大量的客戶端處理的不應使用mysqli_use_result(),因爲這會佔用服務器,並阻止其他線程從更新從中獲取數據的任何表。
這是隻涉及myISAM表還是InnoDB?
根據該文件在mysqli_use_resultmysqli_use_result()和併發
一個如果進行了大量的客戶端處理的不應使用mysqli_use_result(),因爲這會佔用服務器,並阻止其他線程從更新從中獲取數據的任何表。
這是隻涉及myISAM表還是InnoDB?
剛纔檢查:MyISAM
鎖,InnoDB
不鎖:
<?php
$db = new mysqli() or die ("Cannot connect: " . mysqli_connect_error() . "\n");
$query = "SELECT * FROM mytable";
$db->real_query($query) or die ("Cannot fetch: $db->error\n");
$result = $db->use_result() or die ("Cannot use result: $db->error\n");
while($row = $result->fetch_row()) {
print join("\t", $row) . "\n";
usleep(1000000);
}
?>
此鎖:
UPDATE mytable /* isam */ SET myvalue = 'test' WHERE id = 100
這不:
UPDATE mytable /* innodb */ SET myvalue = 'test' WHERE id = 100