diff options
author | Alvaro Herrera | 2020-03-02 21:19:51 +0000 |
---|---|---|
committer | Alvaro Herrera | 2020-03-02 21:19:51 +0000 |
commit | 2f9661311b83dc481fc19f6e3bda015392010a40 (patch) | |
tree | 9a1aabe1d15ac894f7badbc886ae33f16bbfc3b6 /src/include/utils/evtcache.h | |
parent | 7b425a5283cb2c8a452c2e79d6218e41373fd641 (diff) |
Represent command completion tags as structs
The backend was using strings to represent command tags and doing string
comparisons in multiple places, but that's slow and unhelpful. Create a
new command list with a supporting structure to use instead; this is
stored in a tag-list-file that can be tailored to specific purposes with
a caller-definable C macro, similar to what we do for WAL resource
managers. The first first such uses are a new CommandTag enum and a
CommandTagBehavior struct.
Replace numerous occurrences of char *completionTag with a
QueryCompletion struct so that the code no longer stores information
about completed queries in a cstring. Only at the last moment, in
EndCommand(), does this get converted to a string.
EventTriggerCacheItem no longer holds an array of palloc’d tag strings
in sorted order, but rather just a Bitmapset over the CommandTags.
Author: Mark Dilger, with unsolicited help from Álvaro Herrera
Reviewed-by: John Naylor, Tom Lane
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/include/utils/evtcache.h')
-rw-r--r-- | src/include/utils/evtcache.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/include/utils/evtcache.h b/src/include/utils/evtcache.h index 6c3ff81ba37..bc8ce480615 100644 --- a/src/include/utils/evtcache.h +++ b/src/include/utils/evtcache.h @@ -28,8 +28,7 @@ typedef struct { Oid fnoid; /* function to be called */ char enabled; /* as SESSION_REPLICATION_ROLE_* */ - int ntags; /* number of command tags */ - char **tag; /* command tags in SORTED order */ + Bitmapset *tagset; /* command tags, or NULL if empty */ } EventTriggerCacheItem; extern List *EventCacheLookup(EventTriggerEvent event); |