Search Postgresql Archives

Re: A slow query - Help please?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/16/06, Alban Hertroys <alban@xxxxxxxxxxxxxxxxx> wrote:
We really need this solved. Isn't anybody able to shed some light on
this? Is it possible to make this query use an index scan, preferably
w/o disabling sequential scanning?

ditch the inheritance. it is no good, and makes everything too complicated to work with.

in case you can't, do something similar to this:

select * from
(
select * from only table_a  order by number desc limit 25
union
select * from only table_b  order by number desc limit 25
union
select * from only table_c  order by number desc limit 25
) x
order by number desc limit 25;

it should be faster. and yes, i know it's ugly.

depesz

--
http://www.depesz.com/ - nowy, lepszy depesz

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux