Question about Sql SELECT and optimizer

From: "Chaz(dot)" <eprparadocs(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Question about Sql SELECT and optimizer
Date: 2006-03-02 16:19:32
Message-ID: 44071B14.4060906@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I am trying to understand something I have seen happen. I had a select
that looked like:

select f(A) from A, B, C where g(A)

Where f(A) is the select that only depends on table A;
g(A) is the where part that only depends on table A.

What I saw happen was the optimizer will waste a lot of time (seconds!)
bringing in table B and C. I was wondering why doesn't the optimizer
drop references to tables B and C since they aren't used any where?

Peace and thanks in advance
Chuck Wegrzyn

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Maciej Piekielniak 2006-03-02 16:59:28 Re: dump with lo
Previous Message Scott Marlowe 2006-03-02 16:13:09 Re: [SQL] Interval subtracting