RE: Alias in WHERE clause

From: "Eric Jain" <jain(at)gmx(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: RE: Alias in WHERE clause
Date: 2000-05-20 16:39:05
Message-ID: NCBBJFHBEGOIAHBCBNCLKEAACFAA.jain@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-05-20 16:59:57 Re: Alias in WHERE clause
Previous Message moebius 2000-05-20 16:30:31 Re: RPM troubleshoot