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


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to