Skip site navigation (1) Skip section navigation (2)

Re: TSearch2 performance issue?

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TSearch2 performance issue?
Date: 2005-04-04 07:15:52
Message-ID: 4250E9A8.5090105@sigaev.ru (view raw or flat)
Thread:
Lists: 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(at)sigaev(dot)ru
                                                    WWW: http://www.sigaev.ru/

In response to

pgsql-hackers by date

Next:From: Mario ReisDate: 2005-04-04 09:24:17
Subject: Raise Exception
Previous:From: Teodor SigaevDate: 2005-04-04 07:12:36
Subject: Re: TSearch2 performance issue?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group