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 ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match