Re: Another optimizer question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gordan Bobic" <gordan(at)freeuk(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Another optimizer question
Date: 2001-01-18 21:30:09
Message-ID: 5258.979853409@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Gordan Bobic" <gordan(at)freeuk(dot)com> writes:
> SELECT * FROM Table1 INNER JOIN Table2 ON (Table1.Field1 = Table2.Field1)
> WHERE Table1.Field1 = 'SomeValue';
> [ is slow, but this is fast: ]
> SELECT * FROM Table1 INNER JOIN Table2 ON (Table1.Field1 = Table2.Field1)
> WHERE Table1.Field1 = 'SomeValue' AND Table2.Field1 = 'SomeValue';

You're correct, we do not deduce the latter from the former, and so the
first example does not realize that it could use a constrained indexscan
over Table2.

Maybe we should try to do this, but I suspect we'd waste more cycles
trying than we'd make back on the queries where it helps.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-01-18 21:33:22 Re: Tuning queries and distinct behaviour
Previous Message Chris Hayner 2001-01-18 21:23:23 mSQL to PgSQL