I have searched here but can't find anything using the search terms I can come up with. There is probably another post here somewhere that would answer my question but I have failed to find any.
The PHP manual states:
Using this method to fetch large result sets will result in a heavy demand on system and possibly network resources.
It also goes on to say you should use WHERE and ORDER BY to lighten the load which makes perfect sense. But this still does not answer the question, how much is too much? How would you define a result set that is too large?
For example, I wrote this bit of code for a class I am creating:
public function getQuestions($quiz_id){
$quiz_id = parent::onlyNums($quiz_id);
$stmt = $this->db->prepare(
"SELECT quiz.title, quiz.description, questions.question,
questions.answer, questions.wrong_one, questions.wrong_two,
questions.wrong_three FROM quiz, questions WHERE
questions.quiz_id = :quiz_id AND quiz.id = questions.quiz_id");
$stmt->bindValue(':quiz_id',$quiz_id,PDO::PARAM_INT);
try
{
$stmt->execute();
if($stmt->rowCount() > 0 )
{
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}else{
echo "No Items match the query";
exit();
}
}
catch(PDOException $e)
{
return $e->getMessage();
}
}
Now, for the application I am building I would not expect this query to retrieve a massive amount of results because there should never be that many due to the nature of the app. But at some point, if someone went crazy and added millions of questions to a single quiz would this script fail?
Thanks for any info or advice.