Re: a problem with index and user define type

Поиск
Список
Период
Сортировка
От Weiping He
Тема Re: a problem with index and user define type
Дата
Msg-id 3EF668E6.9080107@zhengmai.com.cn
обсуждение исходный текст
Ответ на Re: a problem with index and user define type  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: a problem with index and user define type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

>"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
>
>  
>
Hi, Tom,
   I'm trying to test it, but don't know if I understood you correctly,   you mean we should  try to create the
operatorusing 
 
eqsel/eqjoinsel  estimators, right?   But after we added those estimators like this:

CREATE OPERATOR = (   LEFTARG = uuid,   RIGHTARG = uuid,   COMMUTATOR = =,   NEGATOR = <>,   PROCEDURE = uuid_eq,
RESTRICT= eqsel,   JOIN = eqjoinsel
 
);
   the situation trun worse: now the explain shows the query using the 
index,   the we can't select out the match row! Any hint about what's wrong 
with us?


Thanks and Reagards

Laser




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: O_DIRECT in freebsd
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: O_DIRECT in freebsd