Re: Optimizing projections containing unused columns

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Optimizing projections containing unused columns
Date: 2008-10-15 18:07:28
Message-ID: 38A13F21B5834B21BA31C5170E18E24A@andrusnotebook
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew T. O'Connor 2008-10-15 18:10:56 Re: Drupal and PostgreSQL - performance issues?
Previous Message Tom Lane 2008-10-15 17:36:33 Re: Opptimizing projections containing unused columns