28 messages in com.mysql.lists.mysqlRe: Strange queries| From | Sent On | Attachments |
|---|---|---|
| jo...@chaffee.com | 09 Apr 2001 12:34 | |
| Andrey Kotrekhov | 09 Apr 2001 12:54 | |
| Andrew Schmidt | 09 Apr 2001 13:02 | |
| Brad Barnett | 09 Apr 2001 13:43 | |
| Eric Fitzgerald | 09 Apr 2001 14:23 | |
| Lars Andersson | 09 Apr 2001 14:26 | |
| Tim Bunce | 09 Apr 2001 14:30 | |
| Quentin Bennett | 09 Apr 2001 14:43 | |
| bbar...@L8R.net | 09 Apr 2001 15:35 | |
| Andy Sharp | 09 Apr 2001 15:37 | |
| Johan Andersson | 10 Apr 2001 01:20 | |
| Sinisa Milivojevic | 10 Apr 2001 04:25 | |
| Heikki Tuuri | 10 Apr 2001 05:48 | |
| Jeremy Zawodny | 10 Apr 2001 07:35 | |
| Tim Bunce | 11 Apr 2001 02:31 | |
| Sinisa Milivojevic | 11 Apr 2001 04:21 | |
| Ken Menzel | 11 Apr 2001 06:49 | |
| Sinisa Milivojevic | 11 Apr 2001 06:58 | |
| Andrey Kotrekhov | 11 Apr 2001 07:34 | |
| Lars Andersson | 11 Apr 2001 07:48 | |
| Ken Menzel | 11 Apr 2001 09:33 | .txt |
| Jeremy Zawodny | 11 Apr 2001 10:05 | |
| Tim Bunce | 11 Apr 2001 16:24 | |
| Tim Bunce | 11 Apr 2001 16:26 | |
| Dan Nelson | 11 Apr 2001 20:22 | |
| Sinisa Milivojevic | 12 Apr 2001 04:37 | |
| Ken Menzel | 12 Apr 2001 05:54 | |
| Mark Worsdall | 12 Apr 2001 09:07 |
| Subject: | Re: Strange queries![]() |
|---|---|
| From: | bbar...@L8R.net (bbar...@L8R.net) |
| Date: | 04/09/2001 03:35:59 PM |
| List: | com.mysql.lists.mysql |
On 09-Apr-2001 Eric Fitzgerald wrote:
Since MATCH is evaluated AFTER the where, you need to use HAVING SELECT url,newwebsites.description,newwebsites.title,newwebsites.catid,category.ful lname,MATCH newwebsites.description AGAINST ('aliens') as GOO from newwebsites,category LEFT JOIN userrestrictions ON userrestrictions.name REGEXP '[[:<:]]username|GLOBALAUTHADMIN[[:>:]]' AND newwebsites.catid=userrestrictions.catid where category.catid=newwebsites.catid AND userrestrictions.catid IS NULL AND category.groupid<='1' ORDER BY newwebsites.groupid DESC limit 10 HAVING GOO > 0;
Cool.. thanks. This works, if I put the limit and such after the having, but there's a problem. If I used (as I did before attempting this) :
SELECT url,newwebsites.description,newwebsites.title,newwebsites.catid,category.fullnam e from newwebsites,category LEFT JOIN userrestrictions ON userrestrictions.name REGEXP '[[:<:]]mfeteam99|GLOBALAUTHADMIN[[:>:]]' AND newwebsites.catid=userrestrictions.catid where category.catid=newwebsites.catid AND userrestrictions.catid IS NULL AND category.groupid<='3' AND MATCH newwebsites.description AGAINST ('dogs') ORDER BY newwebsites.groupid DESC limit 10;
10 rows in set (2.11 sec)
I get relatively fast responses... probably because the records searched are limited by restrictions that occur before the MATCH. The same query written as:
SELECT url,newwebsites.description,newwebsites.title,newwebsites.catid,category.fullnam e, MATCH newwebsites.description AGAINST ('big dogs')from newwebsites,category LEFT JOIN userrestrictions ON userrestrictions.name REGEXP '[[:<:]]mfeteam99|GLOBALAUTHADMIN[[:>:]]' AND newwebsites.catid=userrestrictions.catid where category.catid=newwebsites.catid AND userrestrictions.catid IS NULL AND category.groupid<='3' ORDER BY newwebsites.groupid DESC limit 10;
It takes well over a minute to respond. I'm guessing this is because its finding all the matches, and then sorting them due to relevance. Any way to speed this up? Any way to sort by relevance yet keep the query speed down?
---
Dynamic Hosting HTTP://www.L8R.net/ "We Provide Static Hostnames for Dynamic IP's"





.txt