Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling
Дата
Msg-id 20060513193509.GL12955@svana.org
обсуждение исходный текст
Ответ на Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
Список pgsql-patches
[Sorry for the delay, I'm not subscribed to I didn't see your message
till I checked the archive. Please CC for a quicker response.]

> I got two questions after scanning the patch:
>
> (1) For a node with 50 loops and another one 50+10^3 loops, the first
> one will be measured 50 times and the second one will be measured 50+10
> times? I am not sure if this is rational.

You're miscalculating. For N tuples it samples approximatly 1.5*N^(2/3)
so that would be a bit less than 50+150 samples (my little script
suggests 197 samples).

$ perl -MMath::Complex -e '
for $i (1..1050) {
   if( $i < 50 ) { $s++ }
   else {
    if( $i > $t ) { $s++; $t += cbrt($i); }
   }
}; print "$s\n"; '
197

> (2) Will this patch instruct multinode without interval? This is
> because we always use ntuples=0 for multinode, so the tuplecount will
> not change.

Well, if the tuple count always stays under 50 then it will always
sample. At the time it decides whether to sample or not (the beginning
of the node) it obviously has no idea what will be returned.

Have a ncie day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Question on win32 semaphore simulation
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: [PATCH] Warning about configure args (weaker version)