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@xxxxxxxxxx> wrote:
Le mer. 28 juin 2023 à 22:46, Laurenz Albe <laurenz.albe@xxxxxxxxxxx> 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