Re: Inherits and "get highest id". - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Inherits and "get highest id".
Date
Msg-id 20050610122104.GB1365@wolff.to
Whole thread Raw
In response to Inherits and "get highest id".  (Dawid Kuroczko <qnex42@gmail.com>)
List pgsql-general
On Fri, Jun 10, 2005 at 12:27:32 +0200,
  Dawid Kuroczko <qnex42@gmail.com> wrote:
>
> In other words -- doing such a one row select means scanning the
> whole partitioned data.  the primaryindex on logid is not used
> anywhere.  Creating view (SELECT * UNION ALL SELECT * UNION ALL....)
> does not help either.
>
> I wonder -- is there any better solution?  selecting highest from each
> table, unioning it and then selecting highest of the highest works
> well but it strikes me as 'not exactly the niciest implementation'
> (one of the reasons is that I have to remembed about it each time
> new table will be added to schema...).
>
> Any comments, hints?

I seem to remember people getting performance by doing union alls of selects
that explicity list the partition condition; as that will let the planner
speed up checks of tables that cannot result in matches.

pgsql-general by date:

Previous
From: Howard Cole
Date:
Subject: Re: Backup Compatibility between minor versions.
Next
From: Bruce Momjian
Date:
Subject: Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT