From: | "Richard Huxton" <dev(at)archonet(dot)com> |
---|---|
To: | "Mark Cowlishaw" <markc(at)ot(dot)com(dot)au>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: not using table aliases in where clause slow-down? |
Date: | 2001-02-19 09:29:26 |
Message-ID: | 00d901c09a56$778bf5e0$1001a8c0@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
From: "Mark Cowlishaw" <markc(at)ot(dot)com(dot)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(at)ot(dot)com(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas T. Thai | 2001-02-19 09:54:19 | PHP4 Persistent Connection |
Previous Message | Richard Huxton | 2001-02-19 09:25:20 | Re: Default values? |