Re: Dealing with complex queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Dealing with complex queries
Дата
Msg-id 23267.1044586689@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Dealing with complex queries  (Francisco J Reyes <fran@natserv.net>)
Список pgsql-general
Francisco J Reyes <fran@natserv.net> writes:
>                      ->  Nested Loop  (cost=0.00..21773591.67 rows=456 width=51) (actual time=463.34..737215.23
rows=1591loops=1) 
>                            Join Filter: ("outer".ppl_key = "inner".ppl_key)
>                            ->  Index Scan using people_pplkey on people pe  (cost=0.00..2991.02 rows=2234 width=8)
(actualtime=0.19..397.73 rows=1591 loops=1) 
>                                  Filter: (("type" = 'j'::bpchar) AND (jt_id = 0))
>                            ->  Seq Scan on pplkeys ppl  (cost=0.00..8929.70 rows=65324 width=43) (actual
time=0.06..421.59rows=6770 loops=1591) 
>                                  Filter: ("type" = 'j'::bpchar)

Seems the main problem is this innermost join --- it's using the
stupidest possible form of join.  At the very least you'd like it
to use an index on pplkeys.  Are people.ppl_key and pplkeys.ppl_key
the same datatype?  Does the latter have an index?

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with files size in /var/lib/postgres/data/global on Debian Woody
Следующее
От: Tom Lane
Дата:
Сообщение: Re: AllocSetAlloc() error message