Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: 8.3 planner...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 15975 of 16965
Post > Topic >>

Re: 8.3 planner handling of IS NULL in aggregations

by tgl@[EMAIL PROTECTED] (Tom Lane) Jul 4, 2008 at 12:37 PM

Sam Mason <sam@[EMAIL PROTECTED]
> writes:
> I've just noticed that the planner in 8.3.3 doesn't seem to realize the
> difference in the result of the following:
>   GROUP BY col;
>   GROUP BY col IS NULL;

Yeah, estimate_num_groups doesn't have any special knowledge about IS
NULL -- it just sees this as "an expression involving col".  The
general assumption about that is that the expression doesn't reduce
the number of groups (think "col + 1" for example).  In general I'd
rather it overestimated the number of groups than underestimated,
so I don't think this heuristic is really wrong.

Putting in a special case for IS NULL seems a bit silly, but maybe
checking for a boolean result type would cover enough real-world
uses to be worth the trouble?  Not sure.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 3 Posts in Topic:
8.3 planner handling of IS NULL in aggregations
sam@[EMAIL PROTECTED] (S  2008-07-04 15:37:12 
Re: 8.3 planner handling of IS NULL in aggregations
tgl@[EMAIL PROTECTED] (T  2008-07-04 12:37:48 
Re: 8.3 planner handling of IS NULL in aggregations
sam@[EMAIL PROTECTED] (S  2008-07-04 18:22:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 7:26:08 CDT 2008.