Re: Postgresql 8.1.4 - performance issues for select on view using max

Поиск
Список
Период
Сортировка
От Ioana Danes
Тема Re: Postgresql 8.1.4 - performance issues for select on view using max
Дата
Msg-id 20061019112357.66833.qmail@web55908.mail.re3.yahoo.com
обсуждение исходный текст
Ответ на Re: Postgresql 8.1.4 - performance issues for select on  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-performance
Hello,

Actually what I expected from the planner for this
query (select max(transid) from view) was something
like this :

select max(transid) from (select max(transid) from
archive.transaction union all select max(transid) from
public.transaction)

and to apply the max function to each query of the
union. This is what is happening when you use a where
condition, it is using the indexes on each subquery of
the view...
ex: select transid from view where transid = 12;

This way it would be fast enough.

Also for order by and limit I was expecting the same
thing.


Thank you for your time,
Ioana Danes

> constraint exclusion and inheritance won't help him.
>
> The problem is that he has two indexes, and he needs
> to find the max
> between both of them. PostgreSQL isn't smart enough
> to recognize that it
> can use two indexes, find the max in each one, and
> find the max of those
> two values.
>
> Regards,
>     Jeff Davis
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

В списке pgsql-performance по дате отправления:

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: measuring shared memory usage on Windows
Следующее
От: Ioana Danes
Дата:
Сообщение: Re: Postgresql 8.1.4 - performance issues for select on