Re: GiST, Not Using Index - Mailing list pgsql-sql

From Tom Lane
Subject Re: GiST, Not Using Index
Date
Msg-id 27896.1046379102@sss.pgh.pa.us
Whole thread Raw
In response to GiST, Not Using Index  (Itai Zukerman <zukerman@math-hat.com>)
Responses Re: GiST, Not Using Index  (Itai Zukerman <zukerman@math-hat.com>)
List pgsql-sql
Itai Zukerman <zukerman@math-hat.com> 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


pgsql-sql by date:

Previous
From: "Grignon Etienne"
Date:
Subject: Re: pgsql problem
Next
From: Itai Zukerman
Date:
Subject: Re: GiST, Not Using Index