Re: signed short fd

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: signed short fd
Date: 2005-03-14 07:06:14
Message-ID: 5908.1110783974@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> So is there any special reason we don't worry that convert an integer to
> short will not lose data?

It's not possible for that to happen unless the user has set
max_files_per_process to more than 32K, so I'm not particularly
worried. Do you know of any platforms that would be unlikely to
go belly-up with dozens or hundreds of PG backends each trying to use
tens of thousands of open files?

While I agree that storing this as int16 is micro-optimization,
I don't see it as likely to be a problem in the foreseeable
future. If it makes you feel better, we can constrain
max_files_per_process to 32K in guc.c.

> Maybe we make the assumption that all OS will
> implement "fd" as an array index

The POSIX spec requires open() to assign fd's consecutively from zero.
http://www.opengroup.org/onlinepubs/007908799/xsh/open.html

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-14 07:25:50 Re: invalidating cached plans
Previous Message Hannu Krosing 2005-03-14 07:01:09 Re: Raw size