Re: SELECT LIMIT 1 VIEW Performance Issue

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: K C Lau <kclau60(at)netvigator(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: SELECT LIMIT 1 VIEW Performance Issue
Date: 2005-09-22 12:48:04
Message-ID: 1127393284.4145.109.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 2005-09-22 at 18:40 +0800, K C Lau wrote:
> We use similar views as base views throughout our OLTP system to get the
> latest time-based record(s). So it is quite impossible to use summary
> tables etc. Are there other ways to do it?
>
> The subquery would pinpoint the record(s) with the composite primary key.
> Both MS Sql and Oracle do not have such performance problem. So this
> problem is effectively stopping us from migrating to PostgreSQL.
>
> Any suggestions would be most appreciated.

Even if this were fixed for 8.1, which seems unlikely, would you be able
to move to that release immediately?

ISTM you have two choices, in priority, complexity and time/cost order
1) custom mods to your app
2) custom mods to PostgreSQL

Maybe its possible to reconstruct your query with sub-sub-selects so
that you have a correlated query with manually pushed down clauses,
which also references a more constant base view?

Is a 51ms query really such a problem for you?

Best Regards, Simon Riggs

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2005-09-22 14:37:08 Re: SELECT LIMIT 1 VIEW Performance Issue
Previous Message K C Lau 2005-09-22 10:40:46 Re: SELECT LIMIT 1 VIEW Performance Issue