Re: A query that doesn't work on 7.1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A query that doesn't work on 7.1
Дата
Msg-id 3064.984098363@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: A query that doesn't work on 7.1  (Kyle <kyle@actarg.com>)
Список pgsql-sql
Kyle <kyle@actarg.com> writes:
>> You could probably gin up a usable avg(timestamp) using the avg(float8)
>> routines, since a timestamp is really just a double under the hood.

> When you say "gin up" are you talking about C, PL/XXX, or just casts?

I was thinking of full-scale cheating: make a new pg_aggregate entry for
avg(timestamp) that points at the existing pg_proc entries that support
avg(float8).  CREATE AGGREGATE won't do this for you, but there's always
good old INSERT INTO ...

> Here's a view of a union.  The two selects are fast when executed
> individually (and explain confirms that they use indexes).  When I
> query the view, though, it is slow (explain says the scans are
> sequential).

> Is this expected or a bug?

Seems odd.  Need enough info to reproduce, please?
        regards, tom lane


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

Предыдущее
От: Kyle
Дата:
Сообщение: Re: A query that doesn't work on 7.1
Следующее
От: Ken Kline
Дата:
Сообщение: perl dbd