Tom,
> This question is too vague to be answerable --- especially if you want
> an answer that applies across all 8.x releases. I'd suggest
> experimenting a bit using EXPLAIN ANALYZE to see what happens in your
> actual application.
Thank you very much.
I cannot experiment with application currently since this part is at
planning state.
I asked this to get right designing direction.
OK, I will create applicaton so that inner WHERE clauses contain as much
restrictions as it is possible without adding additional tables to
inner SELECTs. Hopefully this cannot be slower than moving those
restrictions to outer select.
A third related issue:
Is it OK to use 5 levels of nested queries like
SELECT ...
FROM ...
(SELECT .. FROM ...
(SELECT ... FROM ..
...
) p1
) p2
or is it better to create queries with as few levels of nestings as possible
?
In some cases we have selection to use UNIONS, JOINS and CREATE TEMP TABLE x
ON COMMIT DROP clauses instead of nested queries but
nested queries look more natural to create.
Currently we are planning to support servers starting at 8.0 so we are not
planning to use WITH statement.
Andrus