Re: HEAD crashes on windows when doing VACUUM ANALYZE

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Matthias <nitrogenycs(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: HEAD crashes on windows when doing VACUUM ANALYZE
Date: 2012-08-30 17:30:10
Message-ID: 503FA322.9070507@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-08-30 17:34:01 Re: SIGFPE handler is naive
Previous Message Robert Haas 2012-08-30 17:28:25 Re: canceling autovacuum task woes