[HACKERS] Row estimation for var const and for NOT (...) queries

2008-04-03 Thread Nikolay Samokhvalov
Hi, I have a table table1 with ~100k rows, the table having flag1 column. The value of flag1 is NULL in 85k+ rows, and it's TRUE in 7k+ rows, and FALSE in 6k rows. I use EXPLAIN to get apprx. number of rows for simple SELECT queries. But in case of ...WHERE NOT flag1 the optimizer is completely

Re: [HACKERS] Row estimation for var const and for NOT (...) queries

2008-04-03 Thread Tom Lane
Nikolay Samokhvalov [EMAIL PROTECTED] writes: I have a table table1 with ~100k rows, the table having flag1 column. The value of flag1 is NULL in 85k+ rows, and it's TRUE in 7k+ rows, and FALSE in 6k rows. Yeah, you're going to have some problems with so many NULLs, I'm sure. -- so, there is