Re: TSearch2 performance issue? - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: TSearch2 performance issue?
Date
Msg-id 4250E9A8.5090105@sigaev.ru
Whole thread Raw
In response to Re: TSearch2 performance issue?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Some thing like instead of

static int
comparedict(const void *a, const void *b)
{        return ((DictInfo *) a)->dict_id - ((DictInfo *) b)->dict_id;
}

now used

static int
comparedict(const void *a, const void *b)
{        if ( ((DictInfo *) a)->dict_id == ((DictInfo *) b)->dict_id )                return 0;        return (
((DictInfo*) a)->dict_id < ((DictInfo *) b)->dict_id ) ? -1 : 1;
 
}

It works for small dict_id ( dict_id has type Oid ), but it was errnous for 
dict_id>2^31.


Christopher Kings-Lynne wrote:
> Hi Teodor,
> 
> What exactly did you fix here?
> 
> Chris
> 
> Teodor Sigaev wrote:
> 
>> I found several unpleasant blot in comparing functions and commit 
>> changes to 7.4, 8.0 and head. Pls check (it need just to recompile .so 
>> file)
>>
>> Christopher Kings-Lynne wrote:
>>
>>>> It's cached. This select should run only one time per connection for 
>>>> each used dictionary. If its'not then it's a bug. I'll check it.
>>>
>>>
>>>
>>>
>>> It probably is then - although I do use a persistent connection pool, 
>>> but I wouldn't have thought that'd use more than a new connection 
>>> every once in a while?
>>>
>>> Chris
>>
>>
>>

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: TSearch2 performance issue?
Next
From: Neil Conway
Date:
Subject: Re: add_missing_from in 8.1