Re: Hash or merge join instead of inner loop

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Hash or merge join instead of inner loop
Дата
Msg-id 274.1055225711@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Hash or merge join instead of inner loop  ("Jim C. Nasby" <jim@nasby.net>)
Ответы Re: Hash or merge join instead of inner loop  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Re: Hash or merge join instead of inner loop  ("Jim C. Nasby" <jim@nasby.net>)
Список pgsql-performance
"Jim C. Nasby" <jim@nasby.net> writes:
> I have a query that's cauing pgsql choose either a hash or merge join
> depending on how I mess with the stats variables, but it won't choose an
> nested loop, even though it's the fastest.

There's been some discussion about that before; you could check the
archives (now that they're up again ;-)).  I believe that the planner
overestimates the cost of a nestloop with inner indexscan, because it
costs the indexscans as though each one is an independent ab-initio
index search.  In reality, most of the upper btree levels will no doubt
stay in memory during such a query, and so this estimate charges many
more reads than really occur.  Fixing this is on the todo list, but no
one's got to it yet.  (It's not clear to me how to put the consideration
into the planner's cost algorithms in a clean way.)

            regards, tom lane

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

Предыдущее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: FW: [ADMIN] Shared_buffers and kernel parameters, tuning
Следующее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: Hash or merge join instead of inner loop