X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B05DF475EE1 for ; Thu, 27 Feb 2003 16:40:25 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 58296-04 for ; Thu, 27 Feb 2003 16:40:15 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 0051D475A4B for ; Thu, 27 Feb 2003 15:51:42 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1RKpg5u027897; Thu, 27 Feb 2003 15:51:42 -0500 (EST) To: Itai Zukerman Cc: pgsql-sql@postgresql.org Subject: Re: GiST, Not Using Index In-reply-to: <87adghtt0h.fsf_-_@pip.dynamiclogic.com> References: <87bs0z1zzs.fsf@matt.w80.math-hat.com> <87lm03ghpo.fsf@matt.w80.math-hat.com> <87adghtt0h.fsf_-_@pip.dynamiclogic.com> Comments: In-reply-to Itai Zukerman message dated "Thu, 27 Feb 2003 14:37:02 -0500" Date: Thu, 27 Feb 2003 15:51:42 -0500 Message-ID: <27896.1046379102@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/602 X-Sequence-Number: 12000 Itai Zukerman writes: > [...some definitions...] Never leave out the "unimportant" stuff --- that's usually where you went wrong ;-) My guess is that you didn't supply a restriction selectivity estimator for the ~>= operator. I forget what the default assumptions are with no estimator, but they're probably not optimistic enough to prompt use of an indexscan. > [...insert 20000 rows into x...] > Seq Scan on x (cost=0.00..2826.01 rows=24334 width=8) > Filter: (z ~>= sig_in('{1,2,3}'::integer[])) *How* many rows did you insert? The planner thinks 24334 will be selected here ... one hopes the default restrictivity estimate is less than 1.0, at least ... regards, tom lane