Fix the miss consideration of tuple_fraction during add_paths_to_append_rel

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Fix the miss consideration of tuple_fraction during add_paths_to_append_rel
Дата
Msg-id CAKU4AWqEnzhUTxopVhENC3vs6NnYV32+e6GSBtp1rAv0ZNX=mQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fix the miss consideration of tuple_fraction during add_paths_to_append_rel
Список pgsql-hackers
When I am working on "Pushing limit into subqueries of a union" [1], I
found we already have a great infrastructure to support this. For a query
like

subquery-1 UNION ALL subquery-2 LIMIT 3;

We have considered the root->tuple_fraction when planning the subqueries
without an extra Limit node as an overhead. But the reason it doesn't work
in my real case is flatten_simple_union_all flat the union all subqueries
into append relation and we didn't handle the root->tuple_fraction during
add_paths_to_append_rel. 

Given the below query for example:
explain analyze
(select * from tenk1 order by hundred)
union all
(select * from tenk2 order by hundred)
limit 3;

Without the patch: Execution Time: 7.856 ms
with the patch:  Execution Time: 0.224 ms

Any suggestion is welcome.

Вложения

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

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: eclg -C ORACLE breaks data
Следующее
От: "Hayato Kuroda (Fujitsu)"
Дата:
Сообщение: RE: [PoC] pg_upgrade: allow to upgrade publisher node