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

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: "long" type is not appropriate for counting tuples
Дата
Msg-id CAH2-Wzk2+4jdf8FC9Qj+2k_52G6EPAwu0yUFMCuPfuMSKppwXA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: "long" type is not appropriate for counting tuples  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: "long" type is not appropriate for counting tuples  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Mon, Apr 29, 2019 at 11:10 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> If we don't want to rely on "L" constants then we'll have to write these
> cases like "work_mem * (size_t) 1024" which is ugly, lots more keystrokes,
> and prone to weird precedence problems unless you throw even more
> keystrokes (parentheses) at it.  I'm not excited about doing that just
> to allow larger work_mem settings on Win64.

I don't think that anybody cares about Win64 very much. Simplifying
the code might lead to larger work_mem settings on that platform, but
that's not the end goal I have in mind. For me, the end goal is
simpler code.

> I'm not suggesting that we don't need to fix uses of "long" for tuple
> counts, and perhaps other things.  But I think getting rid of it in memory
> size calculations might be a lot of work for not a lot of reward.

Whether or not *fully* banning the use of "long" is something that
will simplify the code is debatable. However, we could substantially
reduce the use of "long" across the backend without any real downside.
The work_mem question can be considered later. Does that seem
reasonable?

-- 
Peter Geoghegan



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: "long" type is not appropriate for counting tuples
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: "long" type is not appropriate for counting tuples