Re: need explanation about an explain plan

Поиск
Список
Период
Сортировка
От Umut TEKİN
Тема Re: need explanation about an explain plan
Дата
Msg-id CAPZcZRmbyL28FztKBC5Yco6co9Z=EskKb3M+St+Wh7rh6vJOGw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: need explanation about an explain plan  (Marc Millas <marc.millas@mokadb.com>)
Ответы Re: need explanation about an explain plan
Список pgsql-general
Hi,

@Marc, I think there is no problem.Even though it says it is filtered by ladate, it is not. Because of the partition.
As you can see for each index scan it uses a different partition and those partition boundaries are already specified logically.
For example; "Parallel Index Scan using table1_p_201802_numfic_idx on table1_p_201802 t_3".
If the names correctly matches the partition concept, the partition table1_p_201802 only contains values for between 2018.02.01 and 2018.03.01.
So, even though there is a filter, there is not. Thus, filtering only occurs for your numfic column.

The following link might help to understand how it does reading and skipping. In your case, it does not do any harm, but maybe it would be better change how it looks on the execution plan to prevent confusion.


Thanks!



On Thu, Jun 29, 2023 at 12:08 PM Marc Millas <marc.millas@mokadb.com> wrote:


Le mer. 28 juin 2023 à 22:46, Laurenz Albe <laurenz.albe@cybertec.at> a écrit :
On Wed, 2023-06-28 at 19:25 +0200, Marc Millas wrote:
> Hi Laurenz, as said, in each partition there is only one value for ladate.

The planner doesn't seem to take that into account.
Indeed. I did check values in pg_statistic. And rerun analyze. No change... 

Yours,
Laurenz Albe

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

Предыдущее
От: jian he
Дата:
Сообщение: Re: analyze partition
Следующее
От: pf@pfortin.com
Дата:
Сообщение: psql and pgpass.conf on Windows