Re: proposal: be smarter about i/o patterns in index scan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: proposal: be smarter about i/o patterns in index scan
Дата
Msg-id 20179.1084997405@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: proposal: be smarter about i/o patterns in index scan  ("Glen Parker" <glenebob@nwlink.com>)
Ответы Re: proposal: be smarter about i/o patterns in index scan
Re: proposal: be smarter about i/o patterns in index scan
Список pgsql-hackers
"Glen Parker" <glenebob@nwlink.com> writes:
>> Not unless you add yet another sort step after the fetch step, that is
>> the idea becomes
>> 1. read index to get candidate TIDs
>> 2. sort TIDs into physical order
>> 3. read heap in physical order, check row visibility
>> 4. sort selected rows into index order

> Or:
>   2. Sort AND COPY TID's into physical order.
>   3. Read heap in phy. order, match results to un-sorted TID list.
> That sounds quite cheap.

No, it sounds like handwaving.  What's your "match results" step, and
does it take less than O(N^2) time?  How do you get to *return* the
tuples in index order, without having read them all before you return
the first one?  (Which is really what the problem is with the sort
alternative, at least for fast-start cases such as the LIMIT 1 example.)
What happens when you run out of memory for the list of TIDs ... er,
make that two lists of TIDs?
        regards, tom lane


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Call for 7.5 feature completion
Следующее
От: "Jeffrey W. Baker"
Дата:
Сообщение: Re: proposal: be smarter about i/o patterns in index scan