Re: [HACKERS] [WIP]Vertical Clustered Index (columnar store extension)

Поиск
Список
Период
Сортировка
От Haribabu Kommi
Тема Re: [HACKERS] [WIP]Vertical Clustered Index (columnar store extension)
Дата
Msg-id CAJrrPGcPmzk3eZyd4oY82YJP_Y+4cY2f3TNCyTFRQBUsax0hgQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] [WIP]Vertical Clustered Index (columnar storeextension)  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Ответы Re: [HACKERS] [WIP]Vertical Clustered Index (columnar storeextension)  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Список pgsql-hackers


On Fri, Feb 3, 2017 at 8:28 PM, Konstantin Knizhnik <k.knizhnik@postgrespro.ru> wrote:
On 30.12.2016 06:55, Haribabu Kommi wrote:

Hi All,

Fujitsu was interested in developing a columnar storage extension with minimal
changes the server backend.

We  in PostgresPRO are also very interested in developing vertical storage (VS) for Postgres.
And after considering many alternatives, we came to the conclusion that approach based on representing columnar store as access method (index)
is the most promising one.

It allows to:
1. Implement VS as extension without affecting Postgres core.
2. Have both ROS and WOS.
3. Create multiple projections (as in Vertica).
4. Optimize insert speed by support batch inserts and use flexible recovery model for VS.

So it is very similar with your approach. But there are few differences:

1. Our intention is to completely eliminate changes in Postgres core.

You wrote:
Yes, it is a mix of both index and table access methods. The current design
of Vertical clustered index needs both access methods, because of this reason
we used both access methods.
But I still do not completely understand why it is not possible to use VS in index only scans without any changes and standard Postgres executor?
Why it is not possible to rely on standard rules of applying indexes in Postgres optimizer based on costs provided by our AM implementation?

In our storage design, we used TID-CRID map to identify a record in heap
to columnar storage. Because of HOT update, the new data will not be inserted
into indexes, but this will give problem to the columnar storage, so we added
a hook to insert index data even if the update is HOT. 

And also we added another hook for initializing the parameters during the
execution.

Most of the other added hooks can be replaced with existing hooks and adding
some extra code.
 
2. You are accessing VS pages through Postgres buffer manager. It certainly have a lot of advantages. First of all it significantly simplifies implementation of VS and allows to reuse Postgres cache and lock managers.
But is all leads to some limitation:
- For VS it is preferable to have larger pages (in Vertica size of page can be several megabytes).
- VS is optimized for sequential access, so caching pages in buffer manager is no needed and can only cause leaching of other useful pages from cache.
- It makes it not possible to implement in-memory version of VS.
- Access to buffer manager adds extra synchronization overhead which becomes noticeable at MPP systems.

So I wonder if you have considered approach with VS specific implementation of storage layer?

Currently, we are just using the existing the PostgreSQL buffer manager 
and didn't evaluate any columnar storage specific storage implementation.

we are having some plan of evaluating dynamic shared memory.
 
3. To take all advantages of vertical model, we should provide vector execution.
Without it columnar store can only reduce amount of fetched data by selective fetch of accessed columns and better compression of them.
But this is what existed cstore_fdw extension for Postgres also does.

We are going to use executor hooks or custom nodes to implement vector operations for some nodes (filter, grand aggregate, aggregation with group by,...).
Something similar with  https://github.com/citusdata/postgres_vectorization_test

What is your vision of optimizing executor to work with VS?

Yes, we implemented similar like above by copy/paste the most of the aggregate and etc code
into the extension for providing the vector execution support.

Without this vector execution and parallelism support, there will not be much performance
benefit.

4. How do you consider adding parallelism support to VS? Should it be handled inside VS implementation? Or should we use standard Postgres parallel execution (parallel index-only scan)?


Currently we implemented our own parallelism in columnar storage with some base infrastructure
of OSS, but we are planning to change/integrate according to the OSS implementation.

Regards,
Hari Babu
Fujitsu Australia

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Index corruption with CREATE INDEX CONCURRENTLY
Следующее
От: Haribabu Kommi
Дата:
Сообщение: Re: [HACKERS][REVIEW] macaddr 64 bit (EUI-64) datatype support