Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c
От | Piotr Stefaniak |
---|---|
Тема | Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c |
Дата | |
Msg-id | BLU437-SMTP95EEBC8DD06F30A375ECDFF2840@phx.gbl обсуждение исходный текст |
Ответ на | Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Two division by 0 errors in optimizer/plan/planner.c
and optimizer/path/costsize.c
Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c |
Список | pgsql-hackers |
I'm not saying this is necessarily a bug since the whole function deals with floats, but perhaps it's interesting to note that ndistinct can be 0 in src/backend/utils/adt/selfuncs.c:estimate_hash_bucketsize:/* * Initial estimate of bucketsize fraction is 1/nbucketsas long as the * number of buckets is less than the expected number of distinct values; * otherwise it is 1/ndistinct.*/if (ndistinct > nbuckets) estfract = 1.0 / nbuckets;else estfract = 1.0 / ndistinct; for this query: select subq_0.c1 as c0 from ( select ref_0.a as c0, (select NULL::integer from information_schema.user_defined_types limit 1 offset 1) as c1 from public.rtest_nothn3 as ref_0 limit 130 ) as subq_0 left join ( select sample_0.x as c0 from public.insert_tbl as sample_0 where false ) as subq_1 on subq_0.c1 = subq_1.c0;
В списке pgsql-hackers по дате отправления: