From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>, Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: WIP: Avoid creation of the free space map for small tables |
Date: | 2019-01-17 03:08:00 |
Message-ID: | CAA4eK1KEP-UNP9x4DC5b8S9e4_9aG27XqDp35qJ8hqD18wR+0w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Jan 16, 2019 at 11:25 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> John Naylor <john(dot)naylor(at)2ndquadrant(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2019-01-17 03:35:40 | Re: WIP: Avoid creation of the free space map for small tables |
Previous Message | Andrew Gierth | 2019-01-17 02:48:31 | Re: parseCheckAggregates vs. assign_query_collations |