For example I have this table
Person
id: integer (primary key)
name: varchar
workplace_id: integer
and I want to find the name of people which work in some places, so I used this query
SELECT name FROM Person WHERE workplace_id IN(/*values*/)
Is it better to sort the values first? Or does sorting the values not make any difference in performance? How about the time complexity of the IN operator? If sorting makes better performance, is it considered a premature optimization and should be avoided?