Hello,
the attached patch improves the array selectivity estimation for = ANY
and <> ALL, hence for the IN/NOT IN operators, to avoid the
shortcoming described in
<http://archives.postgresql.org/pgsql-performance/2012-03/msg00006.php>.
Cheers,
-- Daniele