On Tue, Jul 22, 2003 at 05:27:37PM -0600, VanL wrote:
> I have three queries that are essentially identical. Two of them run in
> fractions of a second; one of them takes longer than 15 minutes to
> return. (Not sure how long it totally takes, that has been the limit of
> my patience.)
>
> The only difference between these queries is the use of table aliases in
> the sql query. What is happening in postgres that this makes such a
> difference?
I think the third query is adding items to the FROM clause that you
probably don't want. The result is a cartesian product, which is going
to take eons to materialize (i.e. give results back).
See:
http://www14.us.postgresql.org/docs/7.3/static/sql-select.html#R2-SQL-SELECT-4
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Estoy de acuerdo contigo en que la verdad absoluta no existe...
El problema es que la mentira sí existe y tu estás mintiendo" (G. Lama)