Re: Proposal: Adjacent B-Tree index

Поиск
Список
Период
Сортировка
От Matthias van de Meent
Тема Re: Proposal: Adjacent B-Tree index
Дата
Msg-id CAEze2WgO8VhQ6t6fGOXh8YumFStnZjtSRf4sfpR29s3weKPorg@mail.gmail.com
обсуждение исходный текст
Ответ на Proposal: Adjacent B-Tree index  (Dilshod Urazov <urazofficial@gmail.com>)
Ответы Re: Proposal: Adjacent B-Tree index  (Dilshod Urazov <urazofficial@gmail.com>)
Список pgsql-hackers
On Mon, 19 Feb 2024 at 18:48, Dilshod Urazov <urazofficial@gmail.com> wrote:
>
> - Motivation
>
> A regular B-tree index provides efficient mapping of key values to tuples within a table. However, if you have two
tablesconnected in some way, a regular B-tree index may not be efficient enough. In this case, you would need to create
anindex for each table. The purpose will become clearer if we consider a simple example which is the main use-case as I
seeit. 

I'm not sure why are two indexes not sufficient here? PostgreSQL can
already do merge joins, which would have the same effect of hitting
the same location in the index at the same time between all tables,
without the additional overhead of having to scan two table's worth of
indexes in VACUUM.

> During the vacuum of A an index tuple pointing to a dead tuple in A should be cleaned as well as all index tuples for
thesame key. 

This is definitely not correct. If I have this schema

table test (id int primary key, b text unique)
table test_ref(test_id int references test(id))

and if an index would contain entries for both test and test_ref, it
can't just remove all test_ref entries because an index entry with the
same id was removed: The entry could've been removed because (e.g.)
test's b column was updated thus inserting a new index entry for the
new HOT-chain's TID.

> would suffice for this new semantics.

With the provided explanation I don't think this is a great idea.

Kind regards,

Matthias van de Meent.



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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: PGC_SIGHUP shared_buffers?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: PGC_SIGHUP shared_buffers?