Re: [HACKERS] Multicolumn hash indexes

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: [HACKERS] Multicolumn hash indexes
Дата
Msg-id CAPpHfdvY9eDTW4sk2ocvwbGtdoFm8Oke=6VrO0rUE2GOUhnnWA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Multicolumn hash indexes  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Fri, Sep 29, 2017 at 6:33 PM, Robert Haas <robertmhaas@gmail.com> wrote:
Now you could also imagine something where we keep a separate set of
hash buckets for each column and multi-column searches are handled by
searching each hash table separately and taking the intersection of
the sets of TIDs found for each column.  Not sure that's a good idea,
but it's sort of like what GIN does.

I'd like to note that what GIN does for multicolumn indexes seems quite artificial thing to me.  Logically multicolumn GIN index is the same thing as multiple singlecolumn GIN indexes.  The reason why multicolumn GIN exists is the fact that in particular case GIN does overlapping of scan results over multiple attributes more efficient than our executor do.  Particular case is that scans over multiple columns return ordered sets of TIDs.  GIN implements kind of merge join over TIDs while our executor can only do BitmapAnd in this case.

However, if we imagine that at the moment we develop GIN our executor can do merge join of TIDs produced by multiple index scans, then we wouldn't invent multicolumn GIN at all. Or probably we would invent very different kind of multicolumn GIN.

I mean that multicolumn GIN was a good solution of particular problem from practical side of view.  It allowed to implement very efficient algorithms with minimal changes in planner/executor infrastructure.  However, multicolumn GIN doesn't look like a good design pattern we would like to repeat.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company 

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

Предыдущее
От: Nico Williams
Дата:
Сообщение: [HACKERS] Re: COMMIT TRIGGERs, take n+1
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: [HACKERS] [PATCH]make pg_rewind to not copy useless WAL files