From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | InitProcGlobal cleanup |
Date: | 2011-06-02 17:08:03 |
Message-ID: | BANLkTi=Di9CL4hPSE1zcdUYH_bmotb6ThQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
While working on my patch to reduce the overhead of frequent table
locks, I had cause to monkey with InitProcGlobal() and noticed that
it's sort of a mess. For reasons that are not clear to me, it
allocates one of the three PGPROC arrays using ShemInitStruct() and
the other two using ShmemAlloc(). I'm not clear on why we should use
different functions for different allocations, and it also seems like
it would make sense to do the whole allocation at once instead of
doing three separate ones. Also, the setup of AuxiliaryProcs is
strangely split into two parts, one at the top of the function (where
we allocate the memory) and the other at the bottom (where we
initialize it), but there's no clear reason to break it up like that.
Any reason not to instead do something like the attached?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment | Content-Type | Size |
---|---|---|
init-proc-global-cleanup.patch | application/octet-stream | 3.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2011-06-02 17:13:58 | Re: Hacking gram.y Error syntax error at or near "MERGEJOIN" |
Previous Message | Tom Lane | 2011-06-02 17:06:19 | Re: Please test peer (socket ident) auth on *BSD |