Re: a problem with index and user define type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: a problem with index and user define type
Date
Msg-id 13063.1056255729@sss.pgh.pa.us
Whole thread Raw
In response to a problem with index and user define type  ("Wang Mike" <itlist@msn.com>)
Responses Re: a problem with index and user define type  (Weiping He <laser@zhengmai.com.cn>)
List pgsql-hackers
"Wang Mike" <itlist@msn.com> writes:
> but  this query: select * from test_uuid where id = 
> 'df2b10aa-a31d-11d7-9867-0050babb6029'::uuid   dosn't use index

>                           QUERY PLAN
> ---------------------------------------------------------------
>  Seq Scan on test_uuid  (cost=0.00..22.50 rows=500 width=140)
>    Filter: (id = 'df2b10aa-a31d-11d7-9867-0050babb6029'::uuid)

> why ??

The rows estimate looks pretty fishy --- I think you are getting the
0.5 default selectivity estimate for an operator that has no restriction
estimator.  Most likely you should have created the operator using eqsel
and eqjoinsel as the restriction/join estimators.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Two weeks to feature freeze
Next
From: Bruce Momjian
Date:
Subject: Re: Two weeks to feature freeze