Re: "long" type is not appropriate for counting tuples

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: "long" type is not appropriate for counting tuples
Дата
Msg-id 20190429181919.GA21636@alvherre.pgsql
обсуждение исходный текст
Ответ на "long" type is not appropriate for counting tuples  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: "long" type is not appropriate for counting tuples  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
On 2019-Apr-28, Peter Geoghegan wrote:

> Commit ab0dfc961b6 used a "long" variable within _bt_load() to count
> the number of tuples entered into a B-Tree index as it is built. This
> will not work as expected on Windows, even on 64-bit Windows, because
> "long" is only 32-bits wide. It's far from impossible that you'd have
> ~2 billion index tuples when building a new index.

Agreed.  Here's a patch.  I see downthread that you also discovered the
same mistake in _h_indexbuild by grepping for "long"; I got to it by
examining callers of pgstat_progress_update_param and
pgstat_progress_update_multi_param.  I didn't find any other mistakes of
the same ilk.  Some codesites use "double" instead of "int64", but those
are not broken.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: "long" type is not appropriate for counting tuples
Следующее
От: Andres Freund
Дата:
Сообщение: Re: "long" type is not appropriate for counting tuples