You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your code for count is making request and retrieving data for whole table, that will crash on larger tables when it will try to retrieve more than 100k records, you have identical query and count methods:
public function query($query)
{
$sql = $this->pdo->prepare($query);
$rows=$sql->execute($this->escape);
return $sql->fetchAll(PDO::FETCH_ASSOC);
}
public function count($query)
{
$sql = $this->pdo->prepare($query);
$rows=$sql->execute($this->escape);
return $sql->rowCount();
}
All other databables implementation modify query so query itself will count records like select count(*) from table/
The text was updated successfully, but these errors were encountered:
I'm working on 2.0 version of the library. And just updated the count queries for Mysql and Sqlite dbs. (need to test for other dbs/adapters) 6cd56bb
It must be faster. Can you try it with:
Your code for count is making request and retrieving data for whole table, that will crash on larger tables when it will try to retrieve more than 100k records, you have identical query and count methods:
All other databables implementation modify query so query itself will count records like select count(*) from table/
The text was updated successfully, but these errors were encountered: