MySQL Forums
Forum List  »  General

Is this where clause significantly slower than that where clause?
Posted by: KRISTY ATKINS
Date: February 21, 2023 01:10PM

I've got a where clause that is being generated programmatically in PHP.
I suspect that the way it's written will slow the query down.

Is the first WHERE clause significantly slower than the second WHERE clause?

First Clause:
((answers.QuestionID = 104 AND answers.PredefinedAnswerID = 451) OR (answers.QuestionID = 104 AND answers.PredefinedAnswerID = 452))

Second Clause:
(answers.QuestionID = 104 AND (answers.PredefinedAnswerID = 451 OR answers.PredefinedAnswerID = 452))

Options: ReplyQuote


Subject
Written By
Posted
Is this where clause significantly slower than that where clause?
February 21, 2023 01:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.