Re: Index Skip Scan

Поиск
Список
Период
Сортировка
Искать
От
Tomas Vondra
Тема
Re: Index Skip Scan
Дата
Msg-id
20200208145635.5cgmvgz2gsyvqpgj@development
Ответ на
Re: Index Skip Scan (Dmitry Dolgov)
Список
Дерево обсуждения
Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: Index Skip Scan Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: Index Skip Scan Michael Paquier <michael@paquier.xyz>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: Index Skip Scan Bhushan Uparkar <bhushan.uparkar@gmail.com>
Re: Index Skip Scan Thomas Munro <thomas.munro@enterprisedb.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Stephen Frost <sfrost@snowman.net>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Stephen Frost <sfrost@snowman.net>
Re: Index Skip Scan Andres Freund <andres@anarazel.de>
Re: Index Skip Scan Peter Geoghegan <pg@bowt.ie>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Thomas Munro <thomas.munro@enterprisedb.com>
Re: Index Skip Scan Peter Geoghegan <pg@bowt.ie>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Peter Geoghegan <pg@bowt.ie>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Re: Index Skip Scan James Coleman <jtc331@gmail.com>
Re: Index Skip Scan Andres Freund <andres@anarazel.de>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Jeff Janes <jeff.janes@gmail.com>
Re: Index Skip Scan Jeff Janes <jeff.janes@gmail.com>
Re: Index Skip Scan Thomas Munro <thomas.munro@gmail.com>
Re: Index Skip Scan Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Re: Index Skip Scan Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Floris Van Nee <florisvannee@Optiver.com>
Re: Index Skip Scan Floris Van Nee <florisvannee@Optiver.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Rafia Sabih <rafia.pghackers@gmail.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Floris Van Nee <florisvannee@Optiver.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan James Coleman <jtc331@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Pavel Stehule <pavel.stehule@gmail.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Pavel Stehule <pavel.stehule@gmail.com>
Re: Index Skip Scan Pavel Stehule <pavel.stehule@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Robert Haas <robertmhaas@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Sergei Kornilov <sk@zsrv.org>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Dmitry Dolgov <9erthalion6@gmail.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
Re: Index Skip Scan Jesper Pedersen <jesper.pedersen@redhat.com>
OK,

A couple more comments based on quick review of the patch, particularly
the part related to planning:

1) create_skipscan_unique_path has one assert commented out. Either it's
something we want to enforce, or we should remove it.

   /*Assert(distinctPrefixKeys <= list_length(pathnode->path.pathkeys));*/


2) I wonder if the current costing model is overly optimistic. We simply
copy the startup cost from the IndexPath, which seems fine. But for
total cost we do this:

   pathnode->path.total_cost = basepath->startup_cost * numGroups;

which seems a bit too simplistic. The startup cost is pretty much just
the cost to find the first item in the index, but surely we need to do
more to find the next group - we need to do comparisons to skip some of
the items, etc. If we think that's unnecessary, we need to explain it in
a comment or somthing.


3) I don't think we should make planning dependent on hasDeclareCursor.


4) I'm not quite sure how sensible it's to create a new IndexPath in
create_skipscan_unique_path. On the one hand it works, but I don't think
any other path is constructed like this so I wonder if we're missing
something. Perhaps it'd be better to just add a new path node on top of
the IndexPath, and then handle this in create_plan. We already do
something similar for Bitmap Index Scans, where we create a different
executor node from IndexPath depending on the parent node.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


В списке pgsql-hackers по дате отправления
От: Tomas Vondra
Дата:
Сообщение: Re: Index Skip Scan
От: Justin Pryzby
Дата:
FAQ