Re: PoC Refactor AM analyse API
От
Denis Smirnov
Тема
Re: PoC Refactor AM analyse API
Дата
Msg-id
94A92C72-E6CD-410F-8557-6CDEE04C28B8@arenadata.io
Ответ на
PoC Refactor AM analyse API (Смирнов Денис)
Список
Дерево обсуждения
PoC Refactor AM analyse API Смирнов Денис <sd@arenadata.io>
Re: PoC Refactor AM analyse API Denis Smirnov <sd@arenadata.io>
Re: PoC Refactor AM analyse API Andrey Borodin <x4mmm@yandex-team.ru>
Re: PoC Refactor AM analyse API Denis Smirnov <sd@arenadata.io>
Re: PoC Refactor AM analyse API Andrey Borodin <x4mmm@yandex-team.ru>
Re: PoC Refactor AM analyse API Denis Smirnov <sd@arenadata.io>
Re: PoC Refactor AM analyse API Heikki Linnakangas <hlinnaka@iki.fi>
Re: PoC Refactor AM analyse API Denis Smirnov <sd@arenadata.io>
Re: PoC Refactor AM analyse API Jaime Casanova <jcasanov@systemguards.com.ec>
Re: PoC Refactor AM analyse API Michael Paquier <michael@paquier.xyz>
Re: PoC Refactor AM analyse API Денис Смирнов <sd@arenadata.io>
Re: PoC Refactor AM analyse API Zhihong Yu <zyu@yugabyte.com>
Re: PoC Refactor AM analyse API Denis Smirnov <sd@arenadata.io>
Re: PoC Refactor AM analyse API Zhihong Yu <zyu@yugabyte.com>
It seems that my mailing client set wrong MIME types for attached patch and it was filtered by the web archive. So I attach the patch again for the web archive. > 7 дек. 2020 г., в 23:23, Смирнов Денис написал(а): > > Hello all! > > I suggest a refactoring of analyze AM API as it is too much heap specific at the moment. The problem was inspired by Greenplum’s analyze improvement for append-optimized row and column AM with variable size compressed blocks. > Currently we do analyze in two steps. > > 1. Sample fix size blocks with algorithm S from Knuth (BlockSampler function) > 2. Collect tuples into reservoir with algorithm Z from Vitter. > > So this doesn’t work for AMs using variable sized physical blocks for example. They need weight random sampling (WRS) algorithms like A-Chao or logical blocks to follow S-Knuth (and have a problem with RelationGetNumberOfBlocks() estimating a physical number of blocks). Another problem with columns - they are not passed to analyze begin scan and can’t benefit from column storage at ANALYZE TABLE (COL). > > The suggestion is to replace table_scan_analyze_next_block() and table_scan_analyze_next_tuple() with a single function: table_acquire_sample_rows(). The AM implementation of table_acquire_sample_rows() can use the BlockSampler functions if it wants to, but if the AM is not block-oriented, it could do something else. This suggestion also passes VacAttrStats to table_acquire_sample_rows() for column-oriented AMs and removes PROGRESS_ANALYZE_BLOCKS_TOTAL and PROGRESS_ANALYZE_BLOCKS_DONE definitions as not all AMs can be block-oriented. > > > > > > Best regards, > Denis Smirnov | Developer > sd@arenadata.io > Arenadata | Godovikova 9-17, Moscow 129085 Russia >
В списке pgsql-hackers по дате отправления
От: Kyotaro Horiguchi
Дата:
От: tsunakawa.takay@fujitsu.com
Дата: