I have a query with in_
filter. What I’m trying to figure out – is it more efficient to use tuples or sets as in_
arguments, or are they always converted to lists?
1. ids = [1, 2, 3]
2. ids = {1, 2, 3}
3. ids = (1, 2, 3)
session.query(T).filter(T.id.in_(keys)).all()
All three types works correctly with in_
, but…
- What is the most efficient type for
filter
? - If I have different type, does it have any meaning to convert it to this efficient type?
I’ve looked through documentation but did not find an answer.