1
SELECT * FROM quiz WHERE status='publicado' AND NOT quiz.id_quiz IN (SELECT id_quiz FROM quiz_resolvido WHERE quiz_resolvido.id_usuario=1) order by rand() LIMIT 0,10;
Today I use this Query to select only the quizzes that were not solved by the selected user 1.
It has been very slow because of many rows in the quiz_solved table. Has a better way to display the quizzes that were not solved by the selected user 1?
Expose the structure of your tables (including keys) to evaluate how the database is performing the query
– Sorack
Read that
– Augusto Vasques
In this case you are left with few options, what you can do is create a mv for the quiz_solved table, so you can get faster.
– Alex