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

Re: Tuple sampling

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Tuple sampling
Date: 2004-05-24 10:29:27
Message-ID: 8li3b0l68pbasfri8q2880pml3hd7kppf2@email.aon.at (view raw or flat)
Thread:
Lists: pgsql-patches
On Sun, 23 May 2004 17:32:36 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>I took out the TupleCount typedef and went
>back to using doubles for the tuple counts; this is more consistent with
>the coding style used elsewhere, and I really doubt that it's any
>slower.

Performance was not the primary motivation.  I found it confusing to
have doubles everywhere and not to know whether a variable is declared
as double, because
  . we need the fractional part (e.g. a probability)
  . or it should be able to hold an integral value of more than 32 bits.
So I just invented my own datatype for huge integers.  Long long would
have been a natural choice, but AFAIK its not available on all
platforms.

>I was initially convinced that your implementation of Knuth's algorithm
>S was all wet, so now there's a bunch of comments explaining why it's
>actually correct...

Thanks.  I like your explanation.  My justification for that change was
a lot more complicated.

Servus
 Manfred

In response to

Responses

pgsql-patches by date

Next:From: Neil ConwayDate: 2004-05-24 10:56:34
Subject: updated list rewrite
Previous:From: Fabien COELHODate: 2004-05-24 09:22:02
Subject: Re: add build utilities in default install

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