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

From Alvaro Herrera
Subject Re: gistchoose vs. bloat
Date
Msg-id 20121018180930.GI3763@alvh.no-ip.org
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>)
List pgsql-hackers
Alexander Korotkov escribió:

> > 4. It looks like the randomization is happening while trying to compare
> > the penalties. I think it may be more readable to separate those two
> > steps; e.g.
> >
> >   /* create a mapping whether randomization is on or not */
> >   for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
> >       offsets[i - FirstOffsetNumber] = i;
> >
> >   if (randomization)
> >       /* randomize offsets array */
> >
> >   for (i = 0; i < maxoff; i++)
> >   {
> >      offset = offsets[i];
> >      ...
> >   }
> >
> > That's just an idea; if you think it's more readable as-is (or if I am
> > misunderstanding) then let me know.
>
> Actually, current implementation comes from idea of creating possible less
> overhead when randomization is off. I'll try to measure overhead in worst
> case. If it is low enough then you proposal looks reasonable to me.

Were you able to do these measurements?  If not, I'll defer to your and
Jeff's judgement on what's the best next step here.

Jeff, do you think we need more review of this patch?

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] lock_timeout and common SIGALRM framework
Next
From: Alvaro Herrera
Date:
Subject: Re: Statistics and selectivity estimation for ranges