Re: Speeding up a query by narrowing it down

From: Date: Thu, 30 Nov 2006 04:23:49 +0000
Subject: Re: Speeding up a query by narrowing it down
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-42774@lists.php.net to get a copy of this message
benmoreassynt wrote:
Yeah, I had thought of a subquery, but had not got far with it. I just edited the query to this: SELECT id, LOCATE('my search text', fulltext) FROM contents WHERE MATCH (fulltext) AGAINST ('"my search text"' IN BOOLEAN MODE) AND id IN (SELECT id FROM contents WHERE somefield <= "1600" AND someotherfield >= "1500") The time for the query to process seems to be pretty much exactly the same, and also the same if I omit the nested query entirely (in other words, not limiting by somefield and someotherfield.
What indexes do you have on the table ? Do a: show indexes from table; -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#42774) next »