[HACKERS] [PATCH] Never convert n_distinct 2 values to a ratio when computing stats

2012-03-25 Thread Dan McGee
This is a bit of a corner case in all honesty, but if you have a short table (under 20 rows), the 10% heuristic used that decides whether distinct values scale with the row count will result in rather odd values for stadistinct in pg_statistic, such as '-0.2' or '-0.67', rather than the

Re: [HACKERS] [PATCH] Never convert n_distinct 2 values to a ratio when computing stats

2012-03-25 Thread Robert Haas
On Sat, Mar 24, 2012 at 12:17 AM, Dan McGee d...@archlinux.org wrote: This is a bit of a corner case in all honesty, but if you have a short table (under 20 rows), the 10% heuristic used that decides whether distinct values scale with the row count will result in rather odd values for

Re: [HACKERS] [PATCH] Never convert n_distinct 2 values to a ratio when computing stats

2012-03-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: The bit about maybe not getting both t and f as MCVs on a Boolean does seem a little worrying, but I'm not sure whether it actually affects query planning in a materially negative way. Can you demonstrate a case where it matters? If we were trying to