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

Re: Collect frequency statistics for arrays

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Nathan Boley <npboley(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Collect frequency statistics for arrays
Date: 2012-01-23 18:38:49
Message-ID: CAPpHfdsqAaWN4fqzLXK-fmY3VeXti1=i0Q-DEsyP2VrOcnSzuw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Mon, Jan 23, 2012 at 7:58 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:

> > +     /* Take care about events with low probabilities. */
> > +     if (rest > DEFAULT_CONTAIN_SEL)
> > +     {
>
> Why the change from "rest > 0" to this in the latest version?
>
Ealier addition of "rest" distribution require O(m) time. Now there is a
more accurate and proved estimate, but it takes O(m^2) time.It doesn't make
general assymptotical time worse, but it significant. That's why I decided
to skip for low values of "rest" which don't change distribution
significantly.


>
> > +             /* emit some statistics for debug purposes */
> > +             elog(DEBUG3, "array: target # mces = %d, bucket width =
> %d, "
> > +                      "# elements = %llu, hashtable size = %d, usable
> entries = %d",
> > +                      num_mcelem, bucket_width, element_no, i,
> track_len);
>
> That should be UINT64_FMT.  (I introduced that error in v0.10.)
>
>
> I've attached a new version that includes the UINT64_FMT fix, some edits of
> your newest comments, and a rerun of pgindent on the new files.  I see no
> other issues precluding commit, so I am marking the patch Ready for
> Committer.
>
Great!


> If I made any of the comments worse, please post another update.
>
Changes looks reasonable for me. Thanks!

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

In response to

Responses

pgsql-hackers by date

Next:From: Merlin MoncureDate: 2012-01-23 19:45:34
Subject: Re: Multithread Query Planner
Previous:From: Marko KreenDate: 2012-01-23 17:38:50
Subject: Re: GUC_REPORT for protocol tunables was: Re: Optimize binary serialization format of arrays with fixed size elements

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