Re: [HACKERS] a problem with index and user define type

2003-06-26 Thread Weiping He
Tom Lane wrote: Weiping He <[EMAIL PROTECTED]> writes: because the data type (UUID) is a struct, and the uuid_eq() function accept two pointer to the value of struct uuid, if make it IMMUTABLE, postgresql would think it should not try to run the function, but return the cached value instead whe

Re: [HACKERS] a problem with index and user define type

2003-06-25 Thread Tom Lane
Weiping He <[EMAIL PROTECTED]> writes: > because the data type (UUID) is a struct, > and the uuid_eq() function accept two pointer to the value of struct uuid, > if make it IMMUTABLE, postgresql would think it should not try to run > the function, but return the cached value instead when it get two

Re: [HACKERS] a problem with index and user define type

2003-06-24 Thread Weiping He
Tom Lane wrote: Weiping He <[EMAIL PROTECTED]> writes: we found the problem: We used IMMUTABLE modifier in our CREATE FUNCTION definition, though it's correct for our function to return same value if input the same *data*, but our data are passed by reference, not by value, so, some times we c

Re: [HACKERS] a problem with index and user define type

2003-06-24 Thread Tom Lane
Weiping He <[EMAIL PROTECTED]> writes: > we found the problem: > We used IMMUTABLE modifier in our CREATE FUNCTION definition, > though it's correct for our function to return same value if input the > same *data*, > but our data are passed by reference, not by value, so, some times we can't > ret

Re: [HACKERS] a problem with index and user define type

2003-06-23 Thread Weiping He
we found the problem: We used IMMUTABLE modifier in our CREATE FUNCTION definition, though it's correct for our function to return same value if input the same *data*, but our data are passed by reference, not by value, so, some times we can't retrive out data. Remove IMMUTABLE fixed the problem.

Re: [HACKERS] a problem with index and user define type

2003-06-22 Thread Tom Lane
Weiping He <[EMAIL PROTECTED]> writes: > 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? My bet: either your operators are broken or your operator class definition is wrong.

Re: [HACKERS] a problem with index and user define type

2003-06-22 Thread Weiping He
Tom Lane wrote: "Wang Mike" <[EMAIL PROTECTED]> 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 te

Re: [HACKERS] a problem with index and user define type

2003-06-21 Thread Tom Lane
"Wang Mike" <[EMAIL PROTECTED]> 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=