On Fri, Mar 13, 2015 at 02:54:56PM +0000, maxim.boguk@postgresql-consulting.com wrote:
> As you could see after installing the intarray extension PostgreSQL started
> use a general selectivity estimator. Estimated rows=10000 before create
> extension and estimated rows=10 after, 10000 - correct one.
>
> Problem that custom (redefined) intarray && @> <@ operators are defined with
> contsel/contjoinsel instead of arraycontsel/arraycontjoinsel.
>
> However, simple change extension/intarray--1.0.sql with correct CREATE
> OPERATOR doesn't fix issue:
> test=# explain analyze select * from test where f1 && array[100];
> ERROR: arraycontsel called for unrecognized operator 814221170
>
> I cannot find any quick fix for this issue because OID of custom && operator
> isn't fixed, so no simple change of arraycontsel/arraycontjoinsel possible.
>
> An issue exists in any version since introducing
> arraycontsel/arraycontjoinsel in 9.2 up to HEAD.
Yeah, I am not sure what to recommend here as our custom type optimizer
statistics are not as good as the built-in ones. Did you try running
ANALYZE?
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +