Re: Inherits and "get highest id".

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Dawid Kuroczko <qnex42(at)gmail(dot)com>
Cc: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inherits and "get highest id".
Date: 2005-06-10 12:21:04
Message-ID: 20050610122104.GB1365@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jun 10, 2005 at 12:27:32 +0200,
Dawid Kuroczko <qnex42(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Howard Cole 2005-06-10 12:22:16 Case sensitivity
Previous Message Howard Cole 2005-06-10 12:14:38 Re: Backup Compatibility between minor versions.