Re: IN subquery not using a hash

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: IN subquery not using a hash
Дата
Msg-id 26716.1121904257@sss.pgh.pa.us
обсуждение исходный текст
Ответ на IN subquery not using a hash  (Paul Tillotson <spam1011@adelphia.net>)
Ответы Re: IN subquery not using a hash  (Paul Tillotson <spam1011@adelphia.net>)
Список pgsql-general
Paul Tillotson <spam1011@adelphia.net> writes:
> For the following query, postgres is running the IN subquery over and
> over again (once for each row scanned in the parent table.)
> I would have expected it to run the whole query once and create a hash
> which would then be probed once for every row scanned in the parent
> table.  I assumed that it was not doing so because it thought that the
> resulting hash table would exceed sort_mem,

Hardly likely, considering it's estimating only 296 rows in the subquery
output.  My bet is that you've chosen a datatype whose comparisons are
not hashable (like char(n)).  What is the datatype of parentid in these
tables, anyway?

            regards, tom lane

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

Предыдущее
От: Paul Tillotson
Дата:
Сообщение: IN subquery not using a hash
Следующее
От: Paul Tillotson
Дата:
Сообщение: Re: IN subquery not using a hash