Re: HEAD crashes on windows when doing VACUUM ANALYZE

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: HEAD crashes on windows when doing VACUUM ANALYZE
Дата
Msg-id 503FA322.9070507@iki.fi
обсуждение исходный текст
Ответ на Re: HEAD crashes on windows when doing VACUUM ANALYZE  (Matthias <nitrogenycs@gmail.com>)
Список pgsql-hackers
On 30.08.2012 19:50, Matthias wrote:
> It crashes in rangetypes_typeanalyze.c at line 186:
>
>      delta = (non_empty_cnt - 1) / (num_hist - 1);
>
> According to the debugger num_hist = 1, so it divides by zero. I guess
> this is due to the new statistics collection for range types?

Yep. Fixed, thanks for the report!

I added just a check that the histogram is not created if there are less 
than 2 values in the sample. The corresponding code for scalars also 
checks that there are more than 1 distinct value, so that the histogram 
doesn't consist of all duplicates. We don't currently count the number 
of distinct values for ranges, so that would require a bit more work, 
but I don't think it makes much difference in practice.

- Heikki



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: canceling autovacuum task woes
Следующее
От: Robert Haas
Дата:
Сообщение: Re: SIGFPE handler is naive