Hi, On 2018-12-22 12:20:00 -0500, Tom Lane wrote: > John Naylor <jcnay...@gmail.com> writes: > > Using a single file also gave me another idea: Take value and category > > out of ScanKeyword, and replace them with an index into another array > > containing those, which will only be accessed in the event of a hit. > > That would shrink ScanKeyword to 4 bytes (offset, index), further > > increasing locality of reference. Might not be worth it, but I can try > > it after moving on to the core scanner. > > I like that idea a *lot*, actually, because it offers the opportunity > to decouple this mechanism from all assumptions about what the > auxiliary data for a keyword is.
OTOH, it doubles or triples the number of cachelines accessed when encountering a keyword. The fraction of keywords to not-keywords in SQL makes me wonder whether that makes it a good deal. Greetings, Andres Freund