Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c - Mailing list pgsql-hackers

From Piotr Stefaniak
Subject Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c
Date
Msg-id BLU437-SMTP95EEBC8DD06F30A375ECDFF2840@phx.gbl
Whole thread Raw
In response to Re: Two division by 0 errors in optimizer/plan/planner.c and optimizer/path/costsize.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses 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
List 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 by date:

Previous
From: "Regina Obe"
Date:
Subject: Re: If a schema is created as part of an extension, should all user created tables created in that schema be considered part of the extension?
Next
From: "Regina Obe"
Date:
Subject: Re: Can we amend gitignore so git postgresql works with git on windows using Msys/Mingw64