Re: Sparse bit set data structure

Поиск
Список
Период
Сортировка
От Andrey Borodin
Тема Re: Sparse bit set data structure
Дата
Msg-id B763A044-3773-4DCF-9360-7D834DE0224E@yandex-team.ru
обсуждение исходный текст
Ответ на Re: Sparse bit set data structure  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers
Hi!

Great job!

> 20 марта 2019 г., в 9:10, Heikki Linnakangas <hlinnaka@iki.fi> написал(а):
>
>  Please review, if you have a chance.
>
> - Heikki
> <0001-Add-IntegerSet-to-hold-large-sets-of-64-bit-ints-eff.patch>

I'm looking into the code and have few questions:
1. I'm not sure it is the best interface for iteration
uint64
intset_iterate_next(IntegerSet *intset, bool *found)

we will use it like

while
{
    bool found;
    BlockNumber x = (BlockNumber) intset_iterate_next(is, &found);
    if (!found)
        break;
    // do stuff
}

we could use it like

BlockNumber x;
while(intset_iterate_next(is, &x))
{
    // do stuff
}

But that's not a big difference.


2.
 * Limitations
 * -----------
 *
 * - Values must be added in order.  (Random insertions would require
 *   splitting nodes, which hasn't been implemented.)
 *
 * - Values cannot be added while iteration is in progress.

You check for violation of these limitation in code, but there is not tests for this checks.
Should we add these tests?

Best regards, Andrey Borodin.

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: speeding up planning with partitions
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] generated columns