Re: INDEXng date_trunc ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: INDEXng date_trunc ...
Дата
Msg-id 1433.1006450142@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: INDEXng date_trunc ...  (Brent Verner <brent@rcfile.org>)
Список pgsql-sql
Brent Verner <brent@rcfile.org> writes:
> ... I'm curious
> why we can't take a constant as an argument to an indexed function... 

It's a representational limitation in pg_index: what's stored is a
function OID and a list of column numbers that are its arguments.
There's noplace to put any constant arguments.

I've been toying with the notion of replacing "functional indexes"
with "expressional indexes", wherein the value to be indexed is
computed by any SQL expression (probably refusing subselects and
aggregates though; the restrictions would be the same as for CHECK
constraint expressions).  Other than breaking nigh everything that
looks at pg_index, this seems doable enough, and much more efficient
than writing SQL-language helper functions to accomplish the result.
(SQL-language functions work, but the call overhead is depressing.)

Haven't got round to it yet though ...
        regards, tom lane


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: How are working index with date ?
Следующее
От: Roberto Mello
Дата:
Сообщение: Re: Generate GUID in postgresql