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

Поиск
Список
Период
Сортировка
Искать
От
John Naylor
Тема
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)
Дата
Msg-id
CAJVSVGUUOTd2_Rv46FTcy9Yp6+xMwo0BwdSvPWCaLia_tesQjA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Joerg Sonnenberger <joerg@bec.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Joerg Sonnenberger <joerg@bec.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Joerg Sonnenberger <joerg@bec.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) David Rowley <david.rowley@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Joerg Sonnenberger <joerg@bec.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Joerg Sonnenberger <joerg@bec.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <john.naylor@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <john.naylor@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <john.naylor@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Joerg Sonnenberger <joerg@bec.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <john.naylor@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <john.naylor@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Joerg Sonnenberger <joerg@bec.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <john.naylor@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Joel Jacobson <joel@trustly.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Joel Jacobson <joel@trustly.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Robert Haas <robertmhaas@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) David Fetter <david@fetter.org>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Robert Haas <robertmhaas@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) David Fetter <david@fetter.org>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writablevariables) Andres Freund <andres@anarazel.de>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) Tom Lane <tgl@sss.pgh.pa.us>
Re: reducing the footprint of ScanKeyword (was Re: Large writable variables) John Naylor <jcnaylor@gmail.com>
On 12/26/18, John Naylor  wrote:
> On 12/26/18, Robert Haas  wrote:
>> I wonder if we could do something really simple like a lookup based on
>> the first character of the scan keyword. It looks to me like there are
>> 440 keywords right now, and the most common starting letter is 'c',
>> which is the first letter of 51 keywords. So dispatching based on the
>> first letter clips at least 3 steps off the binary search.  I don't
>> know whether that's enough to be worthwhile, but it's probably pretty
>> simple to implement.

> I agree it'd be fairly simple to do, and might raise the bar for doing
> anything more complex.

I went ahead and did this for v4, but split out into a separate patch.
In addition, I used a heuristic to bypass binary search for the most
common keywords. Normally, the middle value is computed
mathematically, but I found that in each range of keywords beginning
with the same letter, there is often 1 or 2 common keywords that are
good first guesses, such as select, from, join, limit, where. I taught
the lookup to try those first, and then compute subsequent steps the
usual way.

Barring additional bikeshedding on 0001, I'll plan on implementing
offset-based lookup for the other keyword types and retire the old
ScanKeyword. Once that's done, we can benchmark and compare with the
optimizations in 0002.

-John Naylor
В списке pgsql-hackers по дате отправления
От: Magnus Hagander
Дата:
От: Daniel Verite
Дата:
FAQ