Re: stuck on values in 8.2
| От | Richard Broersma Jr |
|---|---|
| Тема | Re: stuck on values in 8.2 |
| Дата | |
| Msg-id | 934915.83815.qm@web31811.mail.mud.yahoo.com обсуждение исходный текст |
| Ответ на | Re: stuck on values in 8.2 (Tom Allison <tom@tacocat.net>) |
| Ответы |
Re: stuck on values in 8.2
Re: stuck on values in 8.2 |
| Список | pgsql-general |
--- Tom Allison <tom@tacocat.net> wrote:
> This is getting really ugly...
> it won't finish in less than .. minutes.
>
> spam=> explain select u2.token_idx, t.token_idx, foo.token from
> tokens t left outer join user_token u1 using (token_idx),
> users u left outer join user_token u2 using (user_idx),
> (values('one'),('want'),('examine'),('three')) as foo(token)
> left outer join tokens using (token)
> where u.user_idx = 15;
It looks to me that your query has (3) left joins and (3) implied cross-joins. Perhaps reforming
your query to eliminate the cross-joins with help performance. In regard to your tables <tokens>
and <user_tokens>, in this query you are referring to (2) separate instances of these tables when
a single instance these tables would probably work just fine. i.e.
tokens t vs. tokens,
user_token u1 vs user_token u2
Regards,
Richard Broersma Jr.
В списке pgsql-general по дате отправления: