From: PFC <lists@peufeu.com>
To: kevin kempter <kevin@kevinkempterllc.com>
To: pgsql-performance@postgresql.org
Subject: Re: Partitioned tables - planner wont use indexes
Date: Fri, 11 Apr 2008 12:41:15 +0200
Message-ID: <op.t9fzy1lncigqcu@apollo13.peufeu.com> (raw)
In-Reply-To: <ADB8460A-F3FF-4A41-A5C4-5D60F4915562@kevinkempterllc.com>
References: <ADB8460A-F3FF-4A41-A5C4-5D60F4915562@kevinkempterllc.com>
> 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).
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: lists@peufeu.com, kevin@kevinkempterllc.com
Subject: Re: Partitioned tables - planner wont use indexes
In-Reply-To: <op.t9fzy1lncigqcu@apollo13.peufeu.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox