Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YXwxl-0002TR-OJ for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Mar 2015 19:15:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YXwxl-00022A-1W for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Mar 2015 19:15:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YXwxk-000224-BM for pgsql-bugs@postgresql.org; Tue, 17 Mar 2015 19:15:36 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YXwxh-00064B-4D for pgsql-bugs@postgresql.org; Tue, 17 Mar 2015 19:15:34 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1YXwxf-0007We-K2; Tue, 17 Mar 2015 15:15:31 -0400 Date: Tue, 17 Mar 2015 15:15:31 -0400 From: Bruce Momjian To: maxim.boguk@postgresql-consulting.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12862: Bug in intarray extension operators (using generic selectivity estimators instead of array oriented) Message-ID: <20150317191531.GE10492@momjian.us> References: <20150313145456.2516.25890@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150313145456.2516.25890@wrigleys.postgresql.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs