Andrus,Hi!
1.From the query plan,it makes no difference.
2.PostgreSQL 8.0+ will not exclude columns c3..c20 while executing.
3.I just make a test,From query plan or executing time,it makes no
difference.
I'm from China.I hope you could see what I mean :)
==
"Andrus" <[EMAIL PROTECTED]> writes:
> Is it OK to put all filters to outer query WHERE clase?
> Or should I move as many filter conditions as possible to inner query so
> that inner query returns 1 records instead of 50 records.
> Is there difference in perfomance if inner query returs l
Tom,
Don't worry about it. All modern Postgres versions ignore columns that
aren't actually used in the query --- at least for examples as simple as
this one. In cases where you intentionally defeat optimization (eg via
OFFSET 0 in a sub-select) it's possible that the sub-select will compute
a
looks like most ppl nowdays have two simple problems, and try to work
against it. Instead they all should focus on getting their data organized
properly, and queries writeen for project before they start to code other
stuff.
The problems are: trying to outsmart db, still belive that you can catch
"Andrus" <[EMAIL PROTECTED]> writes:
> I have lot of autogenerated from projection queries in form
> SELECT source.c1, source.c2, t1.col1, t1.col2, ...
> FROM (SELECT c1, c2, c3, . , c20 FROM ... WHERE ... ) source
> LEFT JOIN t2 USING (somecolumn)
> Main SELECT uses only few columns (source.c1