Re: not using table aliases in where clause slow-down?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: not using table aliases in where clause slow-down?
Дата
Msg-id 00d901c09a56$778bf5e0$1001a8c0@archonet.com
обсуждение исходный текст
Ответ на not using table aliases in where clause slow-down?  ("Mark Cowlishaw" <markc@ot.com.au>)
Список 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 по дате отправления:

Предыдущее
От: "Richard Huxton"
Дата:
Сообщение: Re: Default values?
Следующее
От: "Thomas T. Thai"
Дата:
Сообщение: PHP4 Persistent Connection