Re: Is index enough to do simple fetch, or table is always used too?

Поиск
Список
Период
Сортировка
От Dmitry Koterov
Тема Re: Is index enough to do simple fetch, or table is always used too?
Дата
Msg-id d7df81620812141235h49fae33do951748f86195fd37@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is index enough to do simple fetch, or table is always used too?  ("David Rowley" <dgrowley@gmail.com>)
Ответы Re: Is index enough to do simple fetch, or table is always used too?  ("David Rowley" <dgrowley@gmail.com>)
Список pgsql-general

On Sun, Dec 14, 2008 at 3:36 PM, David Rowley <dgrowley@gmail.com> wrote:
2008/12/14 Dmitry Koterov <dmitry@koterov.ru>:
> The question: if the table "tbl" scanned to fetch "id" and calculate
> md5(id), or the value of "id" is brought directly from "idx" index with no
> table data access at all? The second behaviour is logical: why should we
> access the table if all the needed data is already in the index entry...

In fact not all the required information is in the index. Postgresql
uses Multi-version-concurrency-control, which means there may be multi
versions of the same row. Postgresql must hit the heap (table) no get
the visibility information.

But isn't an index data is also multi-version?
If no, how could a single-versioned index be used to fetch the data from a past snapshot?

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: application readable error message
Следующее
От: "David Rowley"
Дата:
Сообщение: Re: Is index enough to do simple fetch, or table is always used too?