Re: [GENERAL] Wrong estimate in query plan

2013-10-24 Thread David Johnston
Eelke Klein wrote > What I noticed is that are no most common values mentioned ofcourse the > value 1 only occurs once in the column but as all other values are NULL > you > could argue it is a common value. A random sampling is unlikely to choose a record that only appears in 0.1 percent of the t

[GENERAL] Wrong estimate in query plan

2013-10-23 Thread Eelke Klein
In a complex query I have query I noticed that the planner made a bad estimate for a join between two tables in the query (I made sure statistics were up to date). The join was on a single column. In the first table are about 985 rows. All rows except one have a NULL value in the join column the