Re: Speeding up a query by narrowing it down
| From: | Chris | 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: SELECTWhat indexes do you have on the table ? Do a: show indexes from table; -- Postgresql & php tutorials http://www.designmagick.com/id, LOCATE('my search text',fulltext) FROMcontentsWHERE MATCH (fulltext) AGAINST ('"my search text"' IN BOOLEAN MODE) ANDidIN (SELECTidFROMcontentsWHEREsomefield<= "1600" ANDsomeotherfield>= "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 bysomefieldandsomeotherfield.