Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can the following query be optimized ?

SELECT ID FROM note_note 
WHERE BibID=$bid AND isdel=0);
share|improve this question

closed as not constructive by ypercubeᵀᴹ, RolandoMySQLDBA, Derek Downey, Leigh Riffel, Phil Oct 19 '12 at 14:00

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Is it suboptimal? If yes, how? Please, make your questions a bit more meaningful by adding detail. If you don't provide us with details, the best answer is 'Probably yes/no'. Until then, I place a -1 vote. – dezso Sep 14 '12 at 10:15
possible duplicate of query optimization for update nested query IN(SELECT – ypercubeᵀᴹ Sep 14 '12 at 10:46

Add composite indexes to your tables:


On note_note, index (isdel, BibID, ID).

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.