=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= <gryzman(at)gmail(dot)com> writes:
> why :
> select * from foo where X in (1,1,1,1,1,1,1,1) --- same values in search.
> never gets optimized by planner, etc ?
We actually did that, before 8.0 or thereabouts. It was removed because
it cost a lot of planner cycles for *every* query, and helped for only
a small number of stupidly-written ones.
In general, you can probably remove such duplicates on the client side
more efficiently than the database could anyway (realizing that whatever
it might do has to be datatype-independent).
regards, tom lane