gin_fuzzy_search_limit description - Mailing list pgsql-hackers

From Alvaro Herrera
Subject gin_fuzzy_search_limit description
Date
Msg-id 20061129154738.GI3288@alvh.no-ip.org
Whole thread Raw
Responses Re: gin_fuzzy_search_limit description  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
Hi,

I'm not very clear on what this is supposed to mean.  The description in
guc.c is this:
Sets the maximum allowed result for exact search by GIN.

Say again?

The involved code is this:
       if (GinFuzzySearchLimit > 0)       {           /*            * If all of keys more than treshold we will try to
reduceresult,            * we hope (and only hope, for intersection operation of array our            * supposition
isn'ttrue), that total result will not more than            * minimal predictNumberResult.            */
 
           for (i = 0; i < key->nentries; i++)               if (key->scanEntry[i].predictNumberResult <= key->nentries
*GinFuzzySearchLimit)                   return;
 
           for (i = 0; i < key->nentries; i++)               if (key->scanEntry[i].predictNumberResult > key->nentries
*GinFuzzySearchLimit)               {                   key->scanEntry[i].predictNumberResult /= key->nentries;
         key->scanEntry[i].reduceResult = TRUE;               }       }
 
(ginget.c, startScanKey)


The source comment is not very clear either :-)  And I'm not sure I
follow what the code is doing.

Can anyone clarify?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: "Compacting" a relation
Next
From: "Pavel Stehule"
Date:
Subject: Re: [PATCHES] small patch with czech translations for names of months and days