Re: speed of querry?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: speed of querry?
Дата
Msg-id 2799.1113573966@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: speed of querry?  ("Joel Fradkin" <jfradkin@wazagua.com>)
Ответы Re: speed of querry?  ("Joel Fradkin" <jfradkin@wazagua.com>)
Список pgsql-performance
"Joel Fradkin" <jfradkin@wazagua.com> writes:
> "Merge Join  (cost=49697.60..50744.71 rows=14987 width=113) (actual
> time=11301.160..12171.072 rows=160593 loops=1)"
> "  Merge Cond: ("outer".locationid = "inner".locationid)"
> "  ->  Sort  (cost=788.81..789.89 rows=432 width=49) (actual
> time=3.318..3.603 rows=441 loops=1)"
> "        Sort Key: l.locationid"
> "        ->  Index Scan using ix_location on tbllocation l
> (cost=0.00..769.90 rows=432 width=49) (actual time=0.145..2.283 rows=441
> loops=1)"
> "              Index Cond: ('SAKS'::text = (clientnum)::text)"
> "  ->  Sort  (cost=48908.79..49352.17 rows=177352 width=75) (actual
> time=11297.774..11463.780 rows=160594 loops=1)"
> "        Sort Key: a.locationid"
> "        ->  Merge Right Join  (cost=26247.95..28942.93 rows=177352
> width=75) (actual time=8357.010..9335.362 rows=177041 loops=1)"
> "              Merge Cond: ((("outer".clientnum)::text =
> "inner"."?column10?") AND ("outer".id = "inner".jobtitleid))"
> "              ->  Index Scan using ix_tbljobtitle_id on tbljobtitle jt
> (cost=0.00..243.76 rows=6604 width=37) (actual time=0.122..12.049 rows=5690
> loops=1)"
> "                    Filter: (1 = presentationid)"
> "              ->  Sort  (cost=26247.95..26691.33 rows=177352 width=53)
> (actual time=8342.271..8554.943 rows=177041 loops=1)"
> "                    Sort Key: (a.clientnum)::text, a.jobtitleid"
> "                    ->  Index Scan using ix_associate_clientnum on
> tblassociate a  (cost=0.00..10786.17 rows=177352 width=53) (actual
> time=0.166..1126.052 rows=177041 loops=1)"
> "                          Index Cond: ((clientnum)::text = 'SAKS'::text)"
> "Total runtime: 12287.502 ms"

It strikes me as odd that the thing isn't considering hash joins for
at least some of these steps.  Can you force it to (by setting
enable_mergejoin off)?  If not, what are the datatypes of the join
columns exactly?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Foreign key slows down copy/insert
Следующее
От: Richard van den Berg
Дата:
Сообщение: Re: Foreign key slows down copy/insert