Re: referring to computed values from the select list in

Поиск
Список
Период
Сортировка
От Stephen Howard
Тема Re: referring to computed values from the select list in
Дата
Msg-id 40439C45.40100@thunkit.com
обсуждение исходный текст
Ответ на Re: referring to computed values from the select list in the where and order clauses  ("Karl O. Pinc" <kop@meme.com>)
Список pgsql-general
I've decided the STABLE keyword is probably the best bet.  Makes the
query a bit ugly, but does what i want.

Karl O. Pinc wrote:

>
> On 2004.03.01 03:21 Richard Huxton wrote:
>
>> On Monday 01 March 2004 01:04, Stephen Howard wrote:
>> > I've got a moderately complex function defined which i then want to
>> be
>> >
>> > able to test the value of, as well as select the value:
>> >
>> > select id, vector_cosine(document,'[ qw( foo,bar,baz )]') as
>> threshold
>> > from search_vectorspace where threshold > 0 order by threshold desc;
>>
>> However, you can mark functions as immutable/stable/volatile which can
>> allow
>> PG to cache the query results. See the manuals (CREATE FUNCTION) for
>> details.
>
>
> Depending on your requirements you may be able to store the results
> in a temporary table CREATE TABLE TEMP ... ; INSERT INTO...
>
> Don't know that this is a better alternative.
>
> Karl <kop@meme.com>
> Free Software:  "You don't pay back, you pay forward."
>                  -- Robert A. Heinlein
>


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

Предыдущее
От: "Karl O. Pinc"
Дата:
Сообщение: Re: referring to computed values from the select list in the where and order clauses
Следующее
От: Robert Treat
Дата:
Сообщение: Re: Searches on www.postgresql.org failing