Re: WIP: Avoid creation of the free space map for small tables
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: John Naylor <john.naylor@2ndquadrant.com>,
Mithun Cy <mithun.cy@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-01-17T03:08:00Z
Lists: pgsql-hackers
On Wed, Jan 16, 2019 at 11:25 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > John Naylor <john.naylor@2ndquadrant.com> writes: > > It just occured to me that the style FSM_LOCAL_MAP_EXISTS seems more > > common for macros that refer to constants, and FSMLocalMapExists for > > expressions, but I've only seen a small amount of the code base. Do we > > have a style preference here, or is it more a matter of matching the > > surrounding code? > I am fine with the style (FSMLocalMapExists) you are suggesting, but see the similar macros in nearby code like: #define FSM_TREE_DEPTH ((SlotsPerFSMPage >= 1626) ? 3 : 4) I think the above is not an exact match. So, I have looked around and found few other macros which serve a somewhat similar purpose, see below: #define ATT_IS_PACKABLE(att) \ ((att)->attlen == -1 && (att)->attstorage != 'p') #define VARLENA_ATT_IS_PACKABLE(att) \ ((att)->attstorage != 'p') #define CHECK_REL_PROCEDURE(pname) #define SPTEST(f, x, y) \ DatumGetBool(DirectFunctionCall2(f, PointPGetDatum(x), PointPGetDatum(y))) > I believe there's a pretty longstanding tradition in C coding to use > all-caps names for macros representing constants. Some people think > that goes for all macros period, but I'm not on board with that for > function-like macros. > > Different parts of the PG code base make different choices between > camel-case and underscore-separation for multiword function names. > For that, I'd say match the style of nearby code. > Yes, that is what we normally do. However, in some cases, we might need to refer to other places as well which I think is the case here. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
Commits
-
Improve code comments in b0eaa4c51b.
- 06c8a5090ed9 12.0 landed
-
During pg_upgrade, conditionally skip transfer of FSMs.
- 13e8643bfc29 12.0 landed
-
Add more tests for FSM.
- 6f918159a97a 12.0 landed
-
Doc: Update the documentation for FSM behavior for small tables.
- 29d108cdecbe 12.0 landed
-
Make FSM test portable.
- 08ecdfe7e5e0 12.0 landed
-
Avoid creation of the free space map for small heap relations, take 2.
- b0eaa4c51bbf 12.0 landed
-
Move page initialization from RelationAddExtraBlocks() to use, take 2.
- 0d1fe9f74e36 12.0 cited
-
Avoid creation of the free space map for small heap relations.
- ac88d2962a96 12.0 landed
-
In bootstrap mode, don't allow the creation of files if they don't already
- d66e3664b8ba 12.0 landed