Re: making relfilenodes 56 bits
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Robert Haas <robertmhaas@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>,
Andres Freund <andres@anarazel.de>,
Heikki Linnakangas <hlinnaka@iki.fi>,
Thomas Munro <thomas.munro@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>,
vignesh C <vignesh21@gmail.com>
Date: 2022-07-29T20:05:34Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2022-Jul-29, Robert Haas wrote:
>> Yeah, if we think it's OK to pass around structs, then that seems like
>> the right solution. Otherwise functions that take RelFileLocator
>> should be changed to take const RelFileLocator * and we should adjust
>> elsewhere accordingly.
> We do that in other places. See get_object_address() for another
> example. Now, I don't see *why* they do it.
If it's a big struct then avoiding copying it is good; but RelFileLocator
isn't that big.
While researching that statement I did happen to notice that no one has
bothered to update the comment immediately above struct RelFileLocator,
and it is something that absolutely does require attention if there
are plans to make RelFileNumber something other than 32 bits.
* Note: various places use RelFileLocator in hashtable keys. Therefore,
* there *must not* be any unused padding bytes in this struct. That
* should be safe as long as all the fields are of type Oid.
*/
typedef struct RelFileLocator
{
Oid spcOid; /* tablespace */
Oid dbOid; /* database */
RelFileNumber relNumber; /* relation */
} RelFileLocator;
regards, tom lane
Commits
-
Fix typos in comments, code and documentation
- 33ab0a2a527e 16.0 cited
-
Increase width of RelFileNumbers from 32 bits to 56 bits.
- 05d4cbf9b6ba 16.0 landed
-
Move RelFileNumber declarations to common/relpath.h.
- 2f47715cc864 16.0 landed
-
Include RelFileLocator fields individually in BufferTag.
- 82ac34db2036 16.0 landed
-
Convert macros to static inline functions (buf_internals.h)
- 3ac88fddd92c 16.0 landed
-
Remove the restriction that the relmap must be 512 bytes.
- d8cd0c6c95c0 16.0 landed
-
Change internal RelFileNode references to RelFileNumber or RelFileLocator.
- b0a55e43299c 16.0 landed
-
Reorder subskiplsn in pg_subscription to avoid alignment issues.
- 79b716cfb7a1 15.0 cited
-
Fix DROP {DATABASE,TABLESPACE} on Windows.
- 4eb2176318d0 15.0 cited
-
Restructure smgr API as per recent proposal. smgr no longer depends on
- 87bd95638552 8.0.0 cited