Re: Partitioned tables - planner wont use indexes - Mailing list pgsql-performance

From PFC
Subject Re: Partitioned tables - planner wont use indexes
Date
Msg-id op.t9fzy1lncigqcu@apollo13.peufeu.com
Whole thread Raw
In response to Partitioned tables - planner wont use indexes  (kevin kempter <kevin@kevinkempterllc.com>)
List pgsql-performance
> I tried removing the index from the part_master table and got the same
> result

    Since all the data is in the partitions, the part_master table is empty,
so the index is not useful for your query.

> myDB=# explain SELECT min(logdate) FROM part_master;

    Proposals :

    1- Use plpgsql to parse the system catalogs, get the list of partitions,
and issue a min() query against each
    2- Since dates tend to be incrementing, I guess the minimum date must not
be changing that often (unless you delete rows) ; therefore if you need
that information often I suggest a trigger that updates a separate table
which keeps the min_date (perhaps global or for each client, you choose).

pgsql-performance by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Views and functions returning sets of records
Next
From: "Albe Laurenz"
Date:
Subject: Performance increase with elevator=deadline