Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) - Mailing list pgsql-hackers

From John Naylor
Subject Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)
Date
Msg-id CAJVSVGXqPJTDC2n-RosqXc+s=+ai+rZfP8LtEMtnbOJOGTbpYw@mail.gmail.com
Whole thread Raw
In response to Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 12/27/18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> If you really are hot about saving that other 440 bytes, the way to
> do it would be to drop the struct entirely and use two parallel
> arrays, an int16[] for value and a char[] (or better uint8[]) for
> category.  Those would be filled by reading kwlist.h twice with
> different definitions for PG_KEYWORD.  Not sure it's worth the
> trouble though --- in particular, not clear that it's a win from
> the standpoint of number of cache lines touched.

Understood. That said, after re-implementing all keyword lookups, I
wondered if there'd be a notational benefit to dropping the struct,
especially since as yet no caller uses both token and category. It
makes pl_scanner.c and its reserved keyword list a bit nicer, and gets
rid of the need to force frontend to have 'zero' token numbers, but
I'm not sure it's a clear win. I've attached a patch (applies on top
of v6), gzipped to avoid confusing the cfbot.

-John Naylor

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pgsql: Remove WITH OIDS support, change oid catalog columnvisibility.
Next
From: Joerg Sonnenberger
Date:
Subject: Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables)