[SQL] Seq scan on join, not on subselect? analyze this

2008-11-02 Thread Bryce Nesbitt
I'm a bit confused why the query planner is not restricting my join, and not using the index. Two explain analyze statements follow. Why is the second so much better? lyell5= select version(); PostgreSQL 8.3.4 on x86_64-pc-linux-gnu, compiled by GCC cc (GCC) 4.1.2 20061115 (prerelease) (Debian

[SQL] Seq scan on join, not on subselect? analyze this

2008-11-02 Thread Bryce Nesbitt
Dear Postgres Folks, I'm a bit confused why the query planner is not restricting my join, and not using the index. Two explain analyze statements follow. Why is the second so much better? lyell5= vacuum analyze; lyell5= select version(); PostgreSQL 8.3.4 on x86_64-pc-linux-gnu, compiled by GCC

Re: [SQL] Seq scan on join, not on subselect? analyze this

2008-11-02 Thread Tom Lane
Bryce Nesbitt [EMAIL PROTECTED] writes: I'm a bit confused why the query planner is not restricting my join, and not using the index. Two explain analyze statements follow. Why are the rowcount estimates so far off? Maybe you need to increase the statistics target for this table.

Re: [SQL] Seq scan on join, not on subselect? analyze this

2008-11-02 Thread Bryce Nesbitt
Tom Lane wrote: Why are the rowcount estimates so far off? Maybe you need to increase the statistics target for this table. regards, tom lane Tom, How does one tell the rowcount is off in a query plan?  I've never found a great reference on interpreting the query analyze output!