Second version of patch attached. Main changes:
1) ANY and ALL keywords handling.
2) Collecting statistics of array length. It is used in "column <@ const".
3) Relatively accurate estimation of "column <@ const" selectivity. This estimation is most hard part of patch. I'm warrying that there could be too expensibe calculations for estimation. Also, likely current comments don't clearify anything...
------
With best regards,
Alexander Korotkov.