Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL

Поиск
Список
Период
Сортировка
От Mischa Sandberg
Тема Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL
Дата
Msg-id 1115767441.4281429124b9b@webmail.telus.net
обсуждение исходный текст
Ответ на Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Quoting Tom Lane <tgl@sss.pgh.pa.us>:

> Mischa Sandberg <mischa.sandberg@telus.net> writes:
> > The PG hash join is the simplest possible: build a hash table in
> memory,  and match an input stream against it.
>
> [ raised eyebrow... ]  Apparently you've not read the code.  It's
> been hybrid hashjoin since we got it from Berkeley.  Probably not the
> best possible implementation of the concept, but we do
> understand about spill to disk.

Apologies. I stopped reading around line 750 (PG 8.0.1) in
src/backend/executor/nodeHashjoin.c

if (!node->hj_hashdone)
{
    ....
    /*
     * execute the Hash node, to build the hash table
     */
    hashNode->hashtable = hashtable;
    (void) ExecProcNode((PlanState *) hashNode);
    ...

and missed the comment:
    /*
     * Open temp files for outer batches,
     */

Will quietly go and read twice, talk once.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL
Следующее
От: Greg Stark
Дата:
Сообщение: Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL