Re: HEAD crashes on windows when doing VACUUM ANALYZE - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: HEAD crashes on windows when doing VACUUM ANALYZE
Date
Msg-id 503FA322.9070507@iki.fi
Whole thread Raw
In response to Re: HEAD crashes on windows when doing VACUUM ANALYZE  (Matthias <nitrogenycs@gmail.com>)
List 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 by date:

Previous
From: Robert Haas
Date:
Subject: Re: canceling autovacuum task woes
Next
From: Robert Haas
Date:
Subject: Re: SIGFPE handler is naive