Skip to content

Игнорируются партиции при запросе к view #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
barbiedrummer opened this issue Jul 2, 2018 · 2 comments
Labels

Comments

@barbiedrummer
Copy link

Описание проблемы

Имеется такая вьюха:

create or replace view webpush.endpoint as
select
  id, t_text
from warehouse.endpoint_archive
where 1 = 1 /* Хак для планировщика. Без него скипаются партиции и запрос идёт только по пустой parent-таблице. */
union all
select
  id, t_text
from webpush_main_fdw.endpoint;

таблица warehouse.endpoint_archive - партицирована по ID
таблица webpush_main_fdw.endpoint - берётся по fdw с другого сервера

При запросе

select count(*)
  from webpush.endpoint
where id between 1 and 50000

без строчки с хаком получаем план, при котором вообще нет обращения к партициям, хотя все данные лежат в них
image
если использовать хак
image

Это нормальное поведение, если бы использовалась конструкция FROM ONLY. Здесь же, похоже баг.

Environment

image

image

image

@funbringer
Copy link
Collaborator

Добрый день, @barbiedrummer

Спасибо за баг-репорт. Мы выпустим исправление в ближайшее время.

@funbringer funbringer added the bug label Jul 2, 2018
funbringer added a commit that referenced this issue Jul 2, 2018
@funbringer
Copy link
Collaborator

Исправлено в версии 1.4.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants