Re: External search engine, advice - Mailing list pgsql-hackers

From Tom Lane
Subject Re: External search engine, advice
Date
Msg-id 7117.990318022@sss.pgh.pa.us
Whole thread Raw
In response to Re: External search engine, advice  (mlw <markw@mohawksoft.com>)
List pgsql-hackers
mlw <markw@mohawksoft.com> writes:
> If I do:
> create temp table fubar as select ftss_results() as songid;
> select * from cdsongs where songid = fubar.songid;
> That works, but that is slow and a lot of people have emotional difficulties
> with using temporary tables.

If you don't like temp tables, try

select cdsongs.* from cdsongs, (select ftss_results() as ftss) as tmp
where songid = tmp.ftss;

which'll produce the same results.

Do I need to point out that the semantics aren't the same as with IN?
(Unless the output of ftss_results is guaranteed unique...)

> Also, an 'IN' clause does not
> preserve the order of the results, where as a join should.

This statement is flat-out wrong --- don't you know that SQL makes no
promises about tuple ordering?
        regards, tom lane


pgsql-hackers by date:

Previous
From: bpalmer
Date:
Subject: cvs snapshot compile problems
Next
From: Tom Lane
Date:
Subject: Re: Fix for tablename in targetlist