Trying to do very simple thing:
//connecting to remote host
$db = new mysqli($host, $login, $pass, $dbName) or die('cant connect to db');
//table count = 46 644 886 rows
$result = $db->query("SELECT f FROM t") or die($db->error); //no error
echo 'alert!';
The 'alert' text never appears! Later script uses all RAM and system kills it.
Looks like mysqli query tries to fetch all rows in memory. I don't understand that, because only iterator should be returned.