Re: [Proposal] Global temporary tables

Поиск
Список
Период
Сортировка
От Konstantin Knizhnik
Тема Re: [Proposal] Global temporary tables
Дата
Msg-id 3c68995f-0b2e-1c24-d4f5-d2f11c9dd34f@postgrespro.ru
обсуждение исходный текст
Ответ на Re: [Proposal] Global temporary tables  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [Proposal] Global temporary tables  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers

On 31.01.2020 22:38, Robert Haas wrote:
> Now, your idea is not quite as crazy as that, but it has the same
> basic problem: you can't insert code into a low-level facility that
> uses a high level facility which may in turn use and depend on that
> very same low-level facility to not be in the middle of an operation.
> If you do, it's going to break somehow.
>

Thank you for explanation.
You convinced me that building indexes from _bt_getbuf is not good idea.
What do you think about idea to check and build indexes for GTT prior to 
query execution?

In this case we do not need to patch code of all indexes - it can be 
done just in one place.
We can use build function of access method to initialize index and 
populate it with data.

So right now when building query execution plan, optimizer checks if 
index is valid.
If index belongs to GTT, it an check that first page of the index is 
initialized and if not - call build method for this index.

If building index during building query plan is not desirable, we can 
just construct list of indexes which should be checked and
perform check itself and building indexes somewhere after building plan 
but for execution of the query.

Do you seem some problems with such approach?


-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company




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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: Parallel grouping sets
Следующее
От: Konstantin Knizhnik
Дата:
Сообщение: Re: [Proposal] Global temporary tables