RE: Alias in WHERE clause

Поиск
Список
Период
Сортировка
От Eric Jain
Тема RE: Alias in WHERE clause
Дата
Msg-id NCBBJFHBEGOIAHBCBNCLKEAACFAA.jain@gmx.net
обсуждение исходный текст
Ответ на Re: Alias in WHERE clause  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Alias in WHERE clause  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> If it's that expensive you might consider computing and storing the
> results as an additional column in your table ... then you'd not
> have to re-evaluate it for every tuple on each SELECT ...

Thanks... Unfortunatly the 'term' will be different for every query I
can't store any precomputed values. However I figure I could do the
following for every query:

SELECT url,score_a(text, CAST('term' AS TEXT)) AS score
INTO TEMP scores
FROM articles;

SELECT url,score
FROM scores
WHERE score > 0
ORDER BY score DESC;


Now I just hope this won't cause any problems if several users try to
issue different queries at the same time?


--
Eric Jain


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: rules on INSERT can't UPDATE new instance?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Alias in WHERE clause