| 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 |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| 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/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mario Reis | 2005-04-04 09:24:17 | Raise Exception |
| Previous Message | Teodor Sigaev | 2005-04-04 07:12:36 | Re: TSearch2 performance issue? |