I would like to know, how does the size of the IN list affect query planner. I have a query
select distinct on (event_id, tag_id) et.id, e.id as event_id, t.id as tag_id, t.name, t.user_id, t.shared, t.color, case when ea.id <> e.id then true else false end as inherited from do_event e join do_event ea on (ea.tree_id = e.tree_id and ea.lft <= e.lft and ea.rght >= e.rght) join do_event_tags et on (et.event_id = ea.id) join do_tag t on (t.id = et.tag_id) where e.id in (LIST_OF_INTEGERS) and (t.user_id = 14 or t.shared) order by event_id, tag_id, inherited;