At 21:28 5/11/00 -0500, Tom Lane wrote:
>A brute-force answer would be to remove the url_url index ;-)
>dunno if that would slow down other queries, however.

Could you trick it into not using the index (AND using the other strategy?)
by using a calculation:

SELECT ndict.url_id,ndict.intag 
  FROM ndict,url 
 WHERE ndict.word_id=1971739852 
   AND url.rec_id=ndict.url_id  
   AND ( (url.url || ' ') LIKE 'http://www.postgresql.org/% ');

it's a bit nasty.

If you had 7.1, the following might work:

SELECT url_id,intag From 
  (Select ndict.url_id,ndict.intag,url 
  FROM ndict,url 
 WHERE ndict.word_id=1971739852 
   AND url.rec_id=ndict.url_id) as zzz
Where  
   zzz.url LIKE 'http://www.postgresql.org/%'

But I don't know how subselect-in-from handles this sort of query - it
might be 'clever' enough to fold it somehow.




----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

Reply via email to