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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: "long" type is not appropriate for counting tuples
Date: 2019-05-23 13:52:41
Message-ID: CA+TgmoZHfGucEUjPgFrzOEYg=O62F4T7Jc4qC0Lg5BpdVBhC6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 23, 2019 at 5:31 AM Peter Eisentraut
<peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
> Another option is that in cases where it doesn't affect storage layouts,
> like the counting tuples case that started this thread, code could just
> use long long int directly instead of int64. Then if someone wants to
> make it 128 bits or 96 bits or whatever it would not be a problem.

I think that sort of thing tends not to work out well, because at some
point it's likely to be sent out via the wire protocol; at that point
we'll need a value of a certain width. Better to use that width right
from the beginning.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2019-05-23 14:10:55 Re: pgbench - add \aset to store results of a combined query
Previous Message Robert Haas 2019-05-23 13:37:50 Re: Minimal logical decoding on standbys