Afficher un message
Vieux 23/09/2007, 07h24   #2
Luuk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: I need optimizing this query


"Extremest" <admin@binindex> schreef in bericht
news:7I2dnfl829UfVWjbnZ2dnUVZ_ufinZ2d@giganews.com ...
> Here is the query I am currently using.
> It seems to take forever. It keeps wanting to use filesort and a temporary
> can
> anyone plz me. I will send the creates for both tables.
>
> select
> collections.`id`,collections.`subject`,collections .`numfiles`,collections.
> `groups`,
> collections.`size`,collections.`from`,collections. `date`,collections.`nfo`
> FROM temp.collections,temp.nfo where match (nfo.nfo) against
> ('$searchterm'
> in boolean mode) and nfo.cid = collections.id order by `date` desc limit
> 0,50
>


Did you try (this is just a suggestion...) to add an index on `date` and add
in the where clause:
where `date` > someDate

This someDate should be calclulated long enought ago, to get at least 50
records. (i.e 1 month ago, or 6 months ago, depending on the amount of new
records per month in your file)

I think this will trigger MySQL tu use this index, so it will not search the
whole file, but just the found rows, for the file-sort thingie in you
WHERE-clause: [[ match (nfo.nfo) against ('$searchterm' in boolean
ode) ]]



  Réponse avec citation
 
Page generated in 0,06975 seconds with 9 queries