Re: [PERFORM] Estimation question...

2013-02-28 Thread Matt Daw
I get it now... project_id=115 has a frequency of 0.09241 in pg_stats. So if ((project_id = 115) AND (project_id = 115)) is considered as two independent conditions, the row estimate ends up being 0.09241 * 0.09241 * 1.20163e+07 (reltuples from pg_class) = 102614. http://www.postgresql.org/docs/9.

Re: [PERFORM] Estimation question...

2013-02-27 Thread Matt Daw
Quick follow up... I've found that the row estimate in: explain select count(id) from versions where project_id IN (80,115) AND project_id=115; QUERY PLAN