Re: not using table aliases in where clause slow-down? - Mailing list pgsql-general

From Richard Huxton
Subject Re: not using table aliases in where clause slow-down?
Date
Msg-id 00d901c09a56$778bf5e0$1001a8c0@archonet.com
Whole thread Raw
In response to not using table aliases in where clause slow-down?  ("Mark Cowlishaw" <markc@ot.com.au>)
List pgsql-general
From: "Mark Cowlishaw" <markc@ot.com.au>
>
> I noticed that running queries that do -not- use declared table aliases in
> the 'where' clause seem to run a hell-of-a-lot slower than when aliases
are
> used. Is there a valid reason for this? It started out as a typo but now
I'm
> curious.
>
> (7.0.3)
>
> eg:
>
> select
[snip]
>     from
>         releases as rel, subsystems as subs,
>         functions as func, purposes as purp, procedures as proc
>     where
>         rel.project_id        = 53
[snip]
>
> (runs pretty much instantly)
>
> -versus-
>
>
> select
[snip]
>     from
>         releases as rel, subsystems as subs,
>         functions as func, purposes as purp, procedures as proc
>     where
>         releases.project_id        = 53
[snip]
> (I get sick of waiting after > 30sec and ^C the query (in psql))
>
> --
> Mark Cowlishaw <markc@ot.com.au>

I think the second where refers to a different "releases" so it's equivalent
to doing a join without a joining condition (set product? can't remember -
need more coffee). I think it's the same as putting another "releases" in
"from" is what I'm trying to say (badly)

- Richard Huxton


pgsql-general by date:

Previous
From: "Richard Huxton"
Date:
Subject: Re: Default values?
Next
From: "Thomas T. Thai"
Date:
Subject: PHP4 Persistent Connection