We've noticed that question edit page is opening about 15 seconds on question with ~120k answers. The reason is non-effective SQL query in QuizQuestion::hasBeenAnswered(). To check row existence it selects all columns from all rows.

Patch follows.

CommentFileSizeAuthor
#1 quiz-1699728-1.patch2.35 KBdmitriy.trt

Comments

dmitriy.trt’s picture

Status: Active » Needs review
StatusFileSize
new2.35 KB

Patch fixes the problem described above and also adds two indexes. They are used in this query, but there is a number of queries with indexed columns in query conditions or join conditions.

sivaji_ganesh_jojodae’s picture

Status: Needs review » Fixed

Good catch and thanks for your patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 9056c91 on 7.x-4.x, 7.x-5.x by sivaji:
    Issue #1699728: Performance problem: slow question edit page by Dmitriy....

  • Commit 9056c91 on 7.x-4.x, 7.x-5.x, quiz-pages by sivaji:
    Issue #1699728: Performance problem: slow question edit page by Dmitriy....

  • Commit 9056c91 on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 by sivaji:
    Issue #1699728: Performance problem: slow question edit page by Dmitriy....

  • Commit 9056c91 on 7.x-4.x, 7.x-5.x, 2269219 by sivaji:
    Issue #1699728: Performance problem: slow question edit page by Dmitriy....