Re: Optimize single tuple fetch from nbtree index

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Optimize single tuple fetch from nbtree index
Дата
Msg-id CAH2-WzmWGxFNvuYgodGO6zHpenZr_vvgt6QD6Eu3HejOwMUdDg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Optimize single tuple fetch from nbtree index  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Optimize single tuple fetch from nbtree index  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
On Fri, Aug 2, 2019 at 1:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Meh.  I think the odds that you got this 100% right are small, and the
> odds that it would be maintainable are smaller.  There's too much that
> can happen if you're not holding any lock --- and there's a lot of active
> work on btree indexes, which could break whatever assumptions you might
> make today.

I agree that this sounds very scary.

> BTW, you haven't even really made the case that optimizing a query that
> behaves this way is the right thing to be doing ... maybe some other
> plan shape that isn't a nestloop around a LIMIT query would be a better
> solution.

I wonder if some variety of block nested loop join would be helpful
here. I'm not aware of any specific design that would help with
Floris' case, but the idea of reducing the number of scans required on
the inner side by buffering outer side tuples (say based on the
"k=:val" constant) seems like it might generalize well enough. I
suggest Floris look into that possibility. This paper might be worth a
read:

https://dl.acm.org/citation.cfm?id=582278

(Though it also might not be worth a read -- I haven't actually read it myself.)

--
Peter Geoghegan



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: The unused_oids script should have a reminder to use the8000-8999 OID range