Re: gistchoose vs. bloat - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: gistchoose vs. bloat
Date
Msg-id CAPpHfduz2QvqxbpTNbOJk6MOY_p551m1yQVFBAiFac1y1Du4EA@mail.gmail.com
Whole thread Raw
In response to Re: gistchoose vs. bloat  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: gistchoose vs. bloat  (Jeff Davis <pgsql@j-davis.com>)
Re: gistchoose vs. bloat  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Mon, Aug 20, 2012 at 9:13 PM, Alexander Korotkov <aekorotkov@gmail.com> wrote:
Current gistchoose code has a bug. I've started separate thread about it.
Also, it obviously needs more comments.

Current state of patch is more proof of concept than something ready. I'm going to change it in following ways:
1) We don't know how expensive user penalty function is. So, I'm going to change randomization algorithm so that it doesn't increase number of penalty calls in average.
2) Since, randomization could produce additional IO, there are probably no optimal solution for all the cases. We could introduce user-visible option which enables or disables randomization. However, default value of this option is another question.
 
Also, I think you should use random() rather than rand().

Thanks, will fix. 

New version of patch is attached. Parameter "randomization" was introduced. It controls whether to randomize choose. Choose algorithm was rewritten.

------
With best regards,
Alexander Korotkov.
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_upgrade del/rmdir path fix
Next
From: Andrew Dunstan
Date:
Subject: Re: pg_upgrade del/rmdir path fix