I have posts table, post's status is a tinyint
, can be a number between 1-10. I need to select those posts, that have status either of these numbers - 6, 7, 8, 9, 10. So, what solution will be better in terms of performance
1) SELECT id, title, status FROM posts WHERE status > 5
2) SELECT id, title, status FROM posts WHERE status IN(6, 7, 8, 9, 10)
I did not list using OR
, as from this answer IN
is faster
Thanks
UPDATE
status
column is indexed