mysql_query("SELECT `id` FROM `tasks` WHERE `id` NOT IN(1,2,3,4,5,6,7,8,9,10,11)"); NOT IN(1,2,3,4,5,6,7,8,9,10,11) - ведь когда будет много значений, выборка начнётся долгой.
Actually, what are the ways to speed up the sample (indexes are) or can rewrite the exception algorithm? Or is my opinion wrong?
id
! = 1 AND `id! = 2 AND ..., it seems to be faster, although not sure - MySQL can optimize the query with constants and the calls will be the same in speed. - BOPOHid
! = 2, so how can I make so many AND'ov. After all, instead of 1,2,3,4 there is a variable $ tasks_done - ModaL