Re: Optimising compactify_tuples()

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Optimising compactify_tuples()
Дата
Msg-id CA+hUKG+7YRyXvL2pK0FkzM=ZCFPZ9TEwfi3rZJGUO3yoCWWkHQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Optimising compactify_tuples()  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Optimising compactify_tuples()
Список pgsql-hackers
On Wed, Sep 9, 2020 at 3:47 AM David Rowley <dgrowleyml@gmail.com> wrote:
> On Tue, 8 Sep 2020 at 12:08, Thomas Munro <thomas.munro@gmail.com> wrote:
> > One thought is that if we're going to copy everything out and back in
> > again, we might want to consider doing it in a
> > memory-prefetcher-friendly order.  Would it be a good idea to
> > rearrange the tuples to match line pointer order, so that the copying
> > work and also later sequential scans are in a forward direction?
>
> That's an interesting idea but wouldn't that require both the copy to
> the separate buffer *and* a qsort? That's the worst of both
> implementations. We'd need some other data structure too in order to
> get the index of the sorted array by reverse lineitem point, which
> might require an additional array and an additional sort.

Well I may not have had enough coffee yet but I thought you'd just
have to spin though the item IDs twice.  Once to compute sum(lp_len)
so you can compute the new pd_upper, and the second time to copy the
tuples from their random locations on the temporary page to new
sequential locations, so that afterwards item ID order matches offset
order.



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

Предыдущее
От: James Coleman
Дата:
Сообщение: Re: PROC_IN_ANALYZE stillborn 13 years ago
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Improving connection scalability: GetSnapshotData()