Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2019-01-09 Thread Joerg Sonnenberger
On Wed, Jan 09, 2019 at 02:04:15PM -0500, Tom Lane wrote: > Also, in view of finding that the original multiplier choices failed > on the fmgr oid problem, I spent a little effort making the code > able to try more combinations of hash multipliers and seeds. It'd > be nice to have some theory rath

Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2019-01-08 Thread Joerg Sonnenberger
On Tue, Jan 08, 2019 at 05:53:25PM -0500, Tom Lane wrote: > John Naylor writes: > > -As for the graph algorithm, I'd have to play with it to understand > > how it works. > > I improved the comment about how come the hash table entry assignment > works. One thing I'm not clear about myself is >

Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2019-01-06 Thread Joerg Sonnenberger
On Sun, Jan 06, 2019 at 02:29:05PM -0500, Tom Lane wrote: > * It's too bad that the hash function doesn't have a return convention > that allows distinguishing "couldn't possibly match any keyword" from > "might match keyword 0". I imagine a lot of the zero entries in its > hashtable could be inte

Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2019-01-06 Thread Joerg Sonnenberger
On Mon, Jan 07, 2019 at 03:11:55AM +1300, David Rowley wrote: > What I'm most interested in is how long it took to generate the hash > function in hash2.c? It's within the noise floor of time(1) on my laptop, e.g. ~1ms. Joerg

Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2019-01-04 Thread Joerg Sonnenberger
On Fri, Jan 04, 2019 at 02:36:15PM -0800, Andres Freund wrote: > Hi, > > On 2019-01-04 16:43:39 -0500, Tom Lane wrote: > > Joerg Sonnenberger writes: > > >> * What's the generator written in? (if the answer's not "Perl", wedging >

Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2019-01-04 Thread Joerg Sonnenberger
On Fri, Jan 04, 2019 at 03:31:11PM -0500, Tom Lane wrote: > John Naylor writes: > > On 1/3/19, Joerg Sonnenberger wrote: > >> I was pointed at your patch on IRC and decided to look into adding my > >> own pieces. What I can provide you is a fast perfect hash fun

Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2019-01-03 Thread Joerg Sonnenberger
On Sun, Dec 16, 2018 at 11:50:15AM -0500, John Naylor wrote: > A few months ago I was looking into faster search algorithms for > ScanKeywordLookup(), so this is interesting to me. While an optimal > full replacement would be a lot of work, the above ideas are much less > invasive and would still h