Aller au contenu

Requête qui met 3 heures à s exécuter :(


Sujets conseillés

Posté

Bonjour,

voici ma requête qui je sais est foireuse, fonctionnelle, mais ultra lente !! :(

SELECT count(ap.id) as nbphotos, annonces.*, DATE_FORMAT(annonces.date,'%d/%m/%Y') AS dateDMY, DATE_FORMAT(annonces.date,'%H:%i') AS heure, categories.nom as nomsouscategorie,categories.rewriting as rewritingsouscategorie FROM annonces_photos ap, annonces, categories, annonces_champs_valeurs valeurs WHERE activated='y' AND categories.id=annonces.id_souscategorie AND ap.id_annonce=annonces.id AND (valeurs.id_champ = 1 OR valeurs.id_champ = 6) AND valeurs.valeur LIKE '%appart%' AND valeurs.id_annonce=annonces.id AND id_categorie = 4 AND cp LIKE '75%' OR cp LIKE '27660' OR cp LIKE '27630' OR cp LIKE '27660' OR cp LIKE '27420' OR cp LIKE '27720' OR cp LIKE '27140' OR cp LIKE '27720' OR cp LIKE '27830' OR cp LIKE '27720' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28230' OR cp LIKE '28320' OR cp LIKE '28230' OR cp LIKE '28320' OR cp LIKE '28700' OR cp LIKE '28320' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28700' OR cp LIKE '28320' OR cp LIKE '60620' OR cp LIKE '60110' OR cp LIKE '60570' OR cp LIKE '60540' OR cp LIKE '60620' OR cp LIKE '60300' OR cp LIKE '60800' OR cp LIKE '60300' OR cp LIKE '60300' OR cp LIKE '60240' OR cp LIKE '60250' OR cp LIKE '60810' OR cp LIKE '60620' OR cp LIKE '60300' OR cp LIKE '60700' OR cp LIKE '60540' OR cp LIKE '60129' OR cp LIKE '60320' OR cp LIKE '60320' OR cp LIKE '60620' OR cp LIKE '60460' OR cp LIKE '60440' OR cp LIKE '60240' OR cp LIKE '60123' OR cp LIKE '60820' OR cp LIKE '60300' OR cp LIKE '60540' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60620' OR cp LIKE '60620' OR cp LIKE '60240' OR cp LIKE '60810' OR cp LIKE '60440' OR cp LIKE '60870' OR cp LIKE '60730' OR cp LIKE '60300' OR cp LIKE '60230' OR cp LIKE '60240' OR cp LIKE '60500' OR cp LIKE '60520' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60440' OR cp LIKE '60660' OR cp LIKE '60110' OR cp LIKE '60790' OR cp LIKE '60240' OR cp LIKE '60300' OR cp LIKE '60580' OR cp LIKE '60660' OR cp LIKE '60100' OR cp LIKE '60800' OR cp LIKE '60530' OR cp LIKE '60620' OR cp LIKE '60240' OR cp LIKE '60790' OR cp LIKE '60530' OR cp LIKE '60800' OR cp LIKE '60123' OR cp LIKE '60590' OR cp LIKE '60240' OR cp LIKE '60530' OR cp LIKE '60950' OR cp LIKE '60110' OR cp LIKE '60620' OR cp LIKE '60330' OR cp LIKE '60240' OR cp LIKE '60800' OR cp LIKE '60700' OR cp LIKE '60240' OR cp LIKE '60300' OR cp LIKE '60540' OR cp LIKE '60250' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60530' OR cp LIKE '60127' OR cp LIKE '60800' OR cp LIKE '60129' OR cp LIKE '60129' OR cp LIKE '60117' OR cp LIKE '60270' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60119' OR cp LIKE '60141' OR cp LIKE '60173' OR cp LIKE '60240' OR cp LIKE '60570' OR cp LIKE '60730' OR cp LIKE '60330' OR cp LIKE '60290' OR cp LIKE '60260' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60800' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60110' OR cp LIKE '60660' OR cp LIKE '60660' OR cp LIKE '60110' OR cp LIKE '60530' OR cp LIKE '60240' OR cp LIKE '60290' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60950' OR cp LIKE '60160' OR cp LIKE '60810' OR cp LIKE '60790' OR cp LIKE '60240' OR cp LIKE '60300' OR cp LIKE '60300' OR cp LIKE '60119' OR cp LIKE '60530' OR cp LIKE '60127' OR cp LIKE '60128' OR cp LIKE '60570' OR cp LIKE '60440' OR cp LIKE '60320' OR cp LIKE '60530' OR cp LIKE '60119' OR cp LIKE '60180' OR cp LIKE '60730' OR cp LIKE '60440' OR cp LIKE '60810' OR cp LIKE '60620' OR cp LIKE '60800' OR cp LIKE '60129' OR cp LIKE '60560' OR cp LIKE '60240' OR cp LIKE '60440' OR cp LIKE '60128' OR cp LIKE '60330' OR cp LIKE '60520' OR cp LIKE '60700' OR cp LIKE '60700' OR cp LIKE '60790' OR cp LIKE '60460' OR cp LIKE '60540' OR cp LIKE '60810' OR cp LIKE '60620' OR cp LIKE '60240' OR cp LIKE '60790' OR cp LIKE '60410' OR cp LIKE '60870' OR cp LIKE '60410' OR cp LIKE '60800' OR cp LIKE '60440' OR cp LIKE '60620' OR cp LIKE '60660' OR cp LIKE '60800' OR cp LIKE '60620' OR cp LIKE '60810' OR cp LIKE '60117' OR cp LIKE '60149' OR cp LIKE '60730' OR cp LIKE '60410' OR cp LIKE '60340' OR cp LIKE '60740' OR cp LIKE '60410' OR cp LIKE '60660' OR cp LIKE '60300' OR cp LIKE '60240' OR cp LIKE '60240' OR cp LIKE '60800' OR cp LIKE '60330' OR cp LIKE '60240' OR cp LIKE '60520' OR cp LIKE '60160' OR cp LIKE '60890' OR cp LIKE '60240' OR cp LIKE '60590' OR cp LIKE '60590' OR cp LIKE '60800' OR cp LIKE '60730' OR cp LIKE '60790' OR cp LIKE '60240' OR cp LIKE '60117' OR cp LIKE '60950' OR cp LIKE '60550' OR cp LIKE '60440' OR cp LIKE '60117' OR cp LIKE '60175' OR cp LIKE '60410' OR cp LIKE '60810' OR cp LIKE '60620' OR cp LIKE '60870' OR cp LIKE '60340' OR cp LIKE '60590' OR cp LIKE '60500' OR cp LIKE '75000' OR cp LIKE '75001' OR cp LIKE '75002' OR cp LIKE '75003' OR cp LIKE '75004' OR cp LIKE '75005' OR cp LIKE '75006' OR cp LIKE '75007' OR cp LIKE '75008' OR cp LIKE '75009' OR cp LIKE '75010' OR cp LIKE '75011' OR cp LIKE '75012' OR cp LIKE '75013' OR cp LIKE '75014' OR cp LIKE '75015' OR cp LIKE '75016' OR cp LIKE '75017' OR cp LIKE '75018' OR cp LIKE '75019' OR cp LIKE '75020' OR cp LIKE '77390' OR cp LIKE '77410' OR cp LIKE '77630' OR cp LIKE '77390' OR cp LIKE '77440' OR cp LIKE '77720' OR cp LIKE '77700' OR cp LIKE '77630' OR cp LIKE '77910' OR cp LIKE '77390' OR cp LIKE '77540' OR cp LIKE '77115' OR cp LIKE '77590' OR cp LIKE '77350' OR cp LIKE '77350' OR cp LIKE '77310' OR cp LIKE '77720' OR cp LIKE '77580' OR cp LIKE '77470' OR cp LIKE '77720' OR cp LIKE '77170' OR cp LIKE '77177' OR cp LIKE '77600' OR cp LIKE '77600' OR cp LIKE '77400' OR cp LIKE '77515' OR cp LIKE '77930' OR cp LIKE '77240' OR cp LIKE '77930' OR cp LIKE '77144' OR cp LIKE '77910' OR cp LIKE '77390' OR cp LIKE '77720' OR cp LIKE '77420' OR cp LIKE '77660' OR cp LIKE '77600' OR cp LIKE '77720' OR cp LIKE '77540' OR cp LIKE '77370' OR cp LIKE '77610' OR cp LIKE '77410' OR cp LIKE '77410' OR cp LIKE '77590' OR cp LIKE '77820' OR cp LIKE '77820' OR cp LIKE '77610' OR cp LIKE '77390' OR cp LIKE '77500' OR cp LIKE '77700' OR cp LIKE '77173' OR cp LIKE '77410' OR cp LIKE '77370' OR cp LIKE '77090' OR cp LIKE '77380' OR cp LIKE '77290' OR cp LIKE '77600' OR cp LIKE '77450' OR cp LIKE '77440' OR cp LIKE '77170' OR cp LIKE '77860' OR cp LIKE '77580' OR cp LIKE '77700' OR cp LIKE '77540' OR cp LIKE '77390' OR cp LIKE '77390' OR cp LIKE '77181' OR cp LIKE '77154' OR cp LIKE '77580' OR cp LIKE '77580' OR cp LIKE '77124' OR cp LIKE '77610' OR cp LIKE '77390' OR cp LIKE '77183' OR cp LIKE '77165' OR cp LIKE '77190' OR cp LIKE '77230' OR cp LIKE '77163' OR cp LIKE '77400' OR cp LIKE '77139' OR cp LIKE '77830' OR cp LIKE '77820' OR cp LIKE '77184' OR cp LIKE '77450' OR cp LIKE '77139' OR cp LIKE '77166' OR cp LIKE '77515' OR cp LIKE '77220' OR cp LIKE '77133' OR cp LIKE '77150' OR cp LIKE '77164' OR cp LIKE '77930' OR cp LIKE '77590' OR cp LIKE '77370' OR cp LIKE '77370' OR cp LIKE '77610' OR cp LIKE '77165' OR cp LIKE '77130' OR cp LIKE '77390' OR cp LIKE '77410' OR cp LIKE '77470' OR cp LIKE '77910' OR cp LIKE '77165' OR cp LIKE '77400' OR cp LIKE '77720' OR cp LIKE '77410' OR cp LIKE '77220' OR cp LIKE '77166' OR cp LIKE '77580' OR cp LIKE '77600' OR cp LIKE '77390' OR cp LIKE '77515' OR cp LIKE '77580' OR cp LIKE '77850' OR cp LIKE '77610' OR cp LIKE '77440' OR cp LIKE '77450' OR cp LIKE '77165' OR cp LIKE '77450' OR cp LIKE '77600' OR cp LIKE '77230' OR cp LIKE '77400' OR cp LIKE '77148' OR cp LIKE '77450' OR cp LIKE '77150' OR cp LIKE '77127' OR cp LIKE '77550' OR cp LIKE '77550' OR cp LIKE '77220' OR cp LIKE '77000' OR cp LIKE '77440' OR cp LIKE '77185' OR cp LIKE '77230' OR cp LIKE '77540' OR cp LIKE '77133' OR cp LIKE '77700' OR cp LIKE '77950' OR cp LIKE '77580' OR cp LIKE '77230' OR cp LIKE '77139' OR cp LIKE '77100' OR cp LIKE '77610' OR cp LIKE '77990' OR cp LIKE '77145' OR cp LIKE '77100' OR cp LIKE '77350' OR cp LIKE '77000' OR cp LIKE '77990' OR cp LIKE '77410' OR cp LIKE '77290' OR cp LIKE '77950' OR cp LIKE '77550' OR cp LIKE '77470' OR cp LIKE '77950' OR cp LIKE '77144' OR cp LIKE '77230' OR cp LIKE '77122' OR cp LIKE '77450' OR cp LIKE '77720' OR cp LIKE '77163' OR cp LIKE '77230' OR cp LIKE '77230' OR cp LIKE '77176' OR cp LIKE '77370' OR cp LIKE '77100' OR cp LIKE '77230' OR cp LIKE '77124' OR cp LIKE '77610' OR cp LIKE '77186' OR cp LIKE '77178' OR cp LIKE '77280' OR cp LIKE '77330' OR cp LIKE '77390' OR cp LIKE '77830' OR cp LIKE '77124' OR cp LIKE '77930' OR cp LIKE '77131' OR cp LIKE '77181' OR cp LIKE '77165' OR cp LIKE '77165' OR cp LIKE '77440' OR cp LIKE '77470' OR cp LIKE '77515' OR cp LIKE '77400' OR cp LIKE '77340' OR cp LIKE '77135' OR cp LIKE '77410' OR cp LIKE '77220' OR cp LIKE '77310' OR cp LIKE '77139' OR cp LIKE '77720' OR cp LIKE '77860' OR cp LIKE '77550' OR cp LIKE '77000' OR cp LIKE '77680' OR cp LIKE '77230' OR cp LIKE '77540' OR cp LIKE '77950' OR cp LIKE '77310' OR cp LIKE '77470' OR cp LIKE '77950' OR cp LIKE '77930' OR cp LIKE '77860' OR cp LIKE '77660' OR cp LIKE '77230' OR cp LIKE '77630' OR cp LIKE '77720' OR cp LIKE '77410' OR cp LIKE '77720' OR cp LIKE '77178' OR cp LIKE '77930' OR cp LIKE '77165' OR cp LIKE '77400' OR cp LIKE '77920' OR cp LIKE '77210' OR cp LIKE '77580' OR cp LIKE '77176' OR cp LIKE '77240' OR cp LIKE '77700' OR cp LIKE '77170' OR cp LIKE '77115' OR cp LIKE '77111' OR cp LIKE '77111' OR cp LIKE '77230' OR cp LIKE '77810' OR cp LIKE '77400' OR cp LIKE '77163' OR cp LIKE '77200' OR cp LIKE '77131' OR cp LIKE '77220' OR cp LIKE '77450' OR cp LIKE '77470' OR cp LIKE '77440' OR cp LIKE '77360' OR cp LIKE '77830' OR cp LIKE '77910' OR cp LIKE '77580' OR cp LIKE '77000' OR cp LIKE '77390' OR cp LIKE '77240' OR cp LIKE '77450' OR cp LIKE '77470' OR cp LIKE '77174' OR cp LIKE '77174' OR cp LIKE '77230' OR cp LIKE '77124' OR cp LIKE '77270' OR cp LIKE '77410' OR cp LIKE '77410' OR cp LIKE '77190' OR cp LIKE '77580' OR cp LIKE '77230' OR cp LIKE '77139' OR cp LIKE '77540' OR cp LIKE '77950' OR cp LIKE '77580' OR cp LIKE '77870' OR cp LIKE '77390' OR cp LIKE '78660' OR cp LIKE '78260' OR cp LIKE '78240' OR cp LIKE '78660' OR cp LIKE '78580' OR cp LIKE '78770' OR cp LIKE '78570' OR cp LIKE '78790' OR cp LIKE '78410' OR cp LIKE '78610' OR cp LIKE '78930' OR cp LIKE '78126' OR cp LIKE '78770' OR cp LIKE '78770' OR cp LIKE '78870' OR cp LIKE '78550' OR cp LIKE '78580' OR cp LIKE '78490' OR cp LIKE '78910' OR cp LIKE '78650' OR cp LIKE '78930' OR cp LIKE '78660' OR cp LIKE '78200' OR cp LIKE '78390' OR cp LIKE '78490' OR cp LIKE '78830' OR cp LIKE '78410' OR cp LIKE '78380' OR cp LIKE '78113' OR cp LIKE '78930' OR cp LIKE '78610' OR cp LIKE '78440' OR cp LIKE '78530' OR cp LIKE '78200' OR cp LIKE '78830' OR cp LIKE '78955' OR cp LIKE '78420' OR cp LIKE '78720' OR cp LIKE '78170' OR cp LIKE '78720' OR cp LIKE '78240' OR cp LIKE '78570' OR cp LIKE '78130' OR cp LIKE '78117' OR cp LIKE '78400' OR cp LIKE '78450' OR cp LIKE '78150' OR cp LIKE '78460' OR cp LIKE '78460' OR cp LIKE '78120' OR cp LIKE '78340' OR cp LIKE '78310' OR cp LIKE '78700' OR cp LIKE '78121' OR cp LIKE '78290' OR cp LIKE '78720' OR cp LIKE '78810' OR cp LIKE '78440' OR cp LIKE '78920' OR cp LIKE '78990' OR cp LIKE '78125' OR cp LIKE '78680' OR cp LIKE '78690' OR cp LIKE '78620' OR cp LIKE '78740' OR cp LIKE '78410' OR cp LIKE '78810' OR cp LIKE '78910' OR cp LIKE '78410' OR cp LIKE '78520' OR cp LIKE '78330' OR cp LIKE '78440' OR cp LIKE '78112' OR cp LIKE '78250' OR cp LIKE '78490' OR cp LIKE '78950' OR cp LIKE '78490' OR cp LIKE '78890' OR cp LIKE '78440' OR cp LIKE '78125' OR cp LIKE '78770' OR cp LIKE '78930' OR cp LIKE '78490' OR cp LIKE '78930' OR cp LIKE '78440' OR cp LIKE '78280' OR cp LIKE '78250' OR cp LIKE '78790' OR cp LIKE '78580' OR cp LIKE '78125' OR cp LIKE '78800' OR cp LIKE '78440' OR cp LIKE '78440' OR cp LIKE '78760' OR cp LIKE '78350' OR cp LIKE '78580' OR cp LIKE '78820' OR cp LIKE '78440' OR cp LIKE '78320' OR cp LIKE '78520' OR cp LIKE '78350' OR cp LIKE '78730' OR cp LIKE '78430' OR cp LIKE '78200' OR cp LIKE '78114' OR cp LIKE '78600' OR cp LIKE '78200' OR cp LIKE '78200' OR cp LIKE '78770' OR cp LIKE '78490' OR cp LIKE '78750' OR cp LIKE '78124' OR cp LIKE '78160' OR cp LIKE '78580' OR cp LIKE '78780' OR cp LIKE '78310' OR cp LIKE '78670' OR cp LIKE '78490' OR cp LIKE '78600' OR cp LIKE '78320' OR cp LIKE '78490' OR cp LIKE '78250' OR cp LIKE '78970' OR cp LIKE '78250' OR cp LIKE '78940' OR cp LIKE '78470' OR cp LIKE '78840' OR cp LIKE '78124' OR cp LIKE '78440' OR cp LIKE '78360' OR cp LIKE '78490' OR cp LIKE '78180' OR cp LIKE '78630' OR cp LIKE '78130' OR cp LIKE '78640' OR cp LIKE '78640' OR cp LIKE '78410' OR cp LIKE '78590' OR cp LIKE '78250' OR cp LIKE '78125' OR cp LIKE '78910' OR cp LIKE '78630' OR cp LIKE '78125' OR cp LIKE '78660' OR cp LIKE '78910' OR cp LIKE '78660' OR cp LIKE '78230' OR cp LIKE '78610' OR cp LIKE '78370' OR cp LIKE '78125' OR cp LIKE '78300' OR cp LIKE '78730' OR cp LIKE '78440' OR cp LIKE '78560' OR cp LIKE '78910' OR cp LIKE '78660' OR cp LIKE '78940' OR cp LIKE '78125' OR cp LIKE '78120' OR cp LIKE '78590' OR cp LIKE '78730' OR cp LIKE '78150' OR cp LIKE '78790' OR cp LIKE '78440' OR cp LIKE '78730' OR cp LIKE '78210' OR cp LIKE '78720' OR cp LIKE '78640' OR cp LIKE '78100' OR cp LIKE '78125' OR cp LIKE '78470' OR cp LIKE '78610' OR cp LIKE '78660' OR cp LIKE '78790' OR cp LIKE '78520' OR cp LIKE '78730' OR cp LIKE '78860' OR cp LIKE '78470' OR cp LIKE '78690' OR cp LIKE '78500' OR cp LIKE '78650' OR cp LIKE '78720' OR cp LIKE '78790' OR cp LIKE '78200' OR cp LIKE '78120' OR cp LIKE '78910' OR cp LIKE '78250' OR cp LIKE '78850' OR cp LIKE '78770' OR cp LIKE '78117' OR cp LIKE '78190' OR cp LIKE '78490' OR cp LIKE '78510' OR cp LIKE '78740' OR cp LIKE '78140' OR cp LIKE '78480' OR cp LIKE '78540' OR cp LIKE '78320' OR cp LIKE '78000' OR cp LIKE '78930' OR cp LIKE '78110' OR cp LIKE '78490' OR cp LIKE '78125' OR cp LIKE '78670' OR cp LIKE '78450' OR cp LIKE '78930' OR cp LIKE '78770' OR cp LIKE '78640' OR cp LIKE '78220' OR cp LIKE '78960' OR cp LIKE '91470' OR cp LIKE '91290' OR cp LIKE '91200' OR cp LIKE '91410' OR cp LIKE '91830' OR cp LIKE '91580' OR cp LIKE '91630' OR cp LIKE '91160' OR cp LIKE '91610' OR cp LIKE '91590' OR cp LIKE '91570' OR cp LIKE '91590' OR cp LIKE '91870' OR cp LIKE '91790' OR cp LIKE '91070' OR cp LIKE '91470' OR cp LIKE '91850' OR cp LIKE '91800' OR cp LIKE '91150' OR cp LIKE '91820' OR cp LIKE '91880' OR cp LIKE '91220' OR cp LIKE '91650' OR cp LIKE '91650' OR cp LIKE '91150' OR cp LIKE '91640' OR cp LIKE '91800' OR cp LIKE '91680' OR cp LIKE '91440' OR cp LIKE '91590' OR cp LIKE '91780' OR cp LIKE '91730' OR cp LIKE '91750' OR cp LIKE '91160' OR cp LIKE '91410' OR cp LIKE '91580' OR cp LIKE '91630' OR cp LIKE '91750' OR cp LIKE '91380' OR cp LIKE '91100' OR cp LIKE '91410' OR cp LIKE '91830' OR cp LIKE '91490' OR cp LIKE '91080' OR cp LIKE '91720' OR cp LIKE '91680' OR cp LIKE '91560' OR cp LIKE '91490' OR cp LIKE '91590' OR cp LIKE '91410' OR cp LIKE '91210' OR cp LIKE '91540' OR cp LIKE '91520' OR cp LIKE '91860' OR cp LIKE '91360' OR cp LIKE '91150' OR cp LIKE '91450' OR cp LIKE '91580' OR cp LIKE '91000' OR cp LIKE '91590' OR cp LIKE '91700' OR cp LIKE '91640' OR cp LIKE '91540' OR cp LIKE '91410' OR cp LIKE '91470' OR cp LIKE '91190' OR cp LIKE '91400' OR cp LIKE '91940' OR cp LIKE '91410' OR cp LIKE '91350' OR cp LIKE '91630' OR cp LIKE '91590' OR cp LIKE '91430' OR cp LIKE '91760' OR cp LIKE '91510' OR cp LIKE '91640' OR cp LIKE '91260' OR cp LIKE '91510' OR cp LIKE '91630' OR cp LIKE '91310' OR cp LIKE '91470' OR cp LIKE '91310' OR cp LIKE '91090' OR cp LIKE '91160' OR cp LIKE '91310' OR cp LIKE '91460' OR cp LIKE '91630' OR cp LIKE '91300' OR cp LIKE '91730' OR cp LIKE '91540' OR cp LIKE '91780' OR cp LIKE '91490' OR cp LIKE '91470' OR cp LIKE '91590' OR cp LIKE '91230' OR cp LIKE '91310' OR cp LIKE '91420' OR cp LIKE '91150' OR cp LIKE '91390' OR cp LIKE '91250' OR cp LIKE '91750' OR cp LIKE '91290' OR cp LIKE '91620' OR cp LIKE '91290' OR cp LIKE '91540' OR cp LIKE '91400' OR cp LIKE '91590' OR cp LIKE '91120' OR cp LIKE '91550' OR cp LIKE '91470' OR cp LIKE '91220' OR cp LIKE '91410' OR cp LIKE '91480' OR cp LIKE '91410' OR cp LIKE '91130' OR cp LIKE '91410' OR cp LIKE '91400' OR cp LIKE '91190' OR cp LIKE '91530' OR cp LIKE '91410' OR cp LIKE '91410' OR cp LIKE '91700' OR cp LIKE '91180' OR cp LIKE '91250' OR cp LIKE '91780' OR cp LIKE '91940' OR cp LIKE '91530' OR cp LIKE '91240' OR cp LIKE '91280' OR cp LIKE '91250' OR cp LIKE '91910' OR cp LIKE '91770' OR cp LIKE '91650' OR cp LIKE '91160' OR cp LIKE '91600' OR cp LIKE '91530' OR cp LIKE '91840' OR cp LIKE '91450' OR cp LIKE '91580' OR cp LIKE '91250' OR cp LIKE '91730' OR cp LIKE '91530' OR cp LIKE '91480' OR cp LIKE '91640' OR cp LIKE '91430' OR cp LIKE '91820' OR cp LIKE '91370' OR cp LIKE '91810' OR cp LIKE '91710' OR cp LIKE '91890' OR cp LIKE '91270' OR cp LIKE '91100' OR cp LIKE '91140' OR cp LIKE '91580' OR cp LIKE '91620' OR cp LIKE '91140' OR cp LIKE '91360' OR cp LIKE '91580' OR cp LIKE '91190' OR cp LIKE '91700' OR cp LIKE '91170' OR cp LIKE '91320' OR cp LIKE '91330' OR cp LIKE '91940' OR cp LIKE '92160' OR cp LIKE '92600' OR cp LIKE '92220' OR cp LIKE '92270' OR cp LIKE '92100' OR cp LIKE '92340' OR cp LIKE '92290' OR cp LIKE '92320' OR cp LIKE '92370' OR cp LIKE '92140' OR cp LIKE '92110' OR cp LIKE '92700' OR cp LIKE '92400' OR cp LIKE '92260' OR cp LIKE '92380' OR cp LIKE '92250' OR cp LIKE '92230' OR cp LIKE '92130' OR cp LIKE '92300' OR cp LIKE '92240' OR cp LIKE '92430' OR cp LIKE '92190' OR cp LIKE '92120' OR cp LIKE '92000' OR cp LIKE '92200' OR cp LIKE '92350' OR cp LIKE '92800' OR cp LIKE '92500' OR cp LIKE '92210' OR cp LIKE '92330' OR cp LIKE '92310' OR cp LIKE '92150' OR cp LIKE '92170' OR cp LIKE '92420' OR cp LIKE '92410' OR cp LIKE '92390' OR cp LIKE '93300' OR cp LIKE '93600' OR cp LIKE '93170' OR cp LIKE '93150' OR cp LIKE '93000' OR cp LIKE '93140' OR cp LIKE '93350' OR cp LIKE '93390' OR cp LIKE '93470' OR cp LIKE '93120' OR cp LIKE '93700' OR cp LIKE '93440' OR cp LIKE '93800' OR cp LIKE '93220' OR cp LIKE '93460' OR cp LIKE '93450' OR cp LIKE '93260' OR cp LIKE '93190' OR cp LIKE '93370' OR cp LIKE '93100' OR cp LIKE '93360' OR cp LIKE '93330' OR cp LIKE '93160' OR cp LIKE '93130' OR cp LIKE '93500' OR cp LIKE '93320' OR cp LIKE '93380' OR cp LIKE '93310' OR cp LIKE '93340' OR cp LIKE '93230' OR cp LIKE '93110' OR cp LIKE '93200' OR cp LIKE '93400' OR cp LIKE '93270' OR cp LIKE '93240' OR cp LIKE '93290' OR cp LIKE '93410' OR cp LIKE '93250' OR cp LIKE '93420' OR cp LIKE '93430' OR cp LIKE '94480' OR cp LIKE '94140' OR cp LIKE '94110' OR cp LIKE '94470' OR cp LIKE '94380' OR cp LIKE '94360' OR cp LIKE '94230' OR cp LIKE '94500' OR cp LIKE '94220' OR cp LIKE '94430' OR cp LIKE '94550' OR cp LIKE '94600' OR cp LIKE '94000' OR cp LIKE '94120' OR cp LIKE '94260' OR cp LIKE '94250' OR cp LIKE '94240' OR cp LIKE '94200' OR cp LIKE '94340' OR cp LIKE '94270' OR cp LIKE '94450' OR cp LIKE '94700' OR cp LIKE '94520' OR cp LIKE '94440' OR cp LIKE '94130' OR cp LIKE '94880' OR cp LIKE '94310' OR cp LIKE '94490' OR cp LIKE '94520' OR cp LIKE '94170' OR cp LIKE '94420' OR cp LIKE '94510' OR cp LIKE '94150' OR cp LIKE '94160' OR cp LIKE '94100' OR cp LIKE '94410' OR cp LIKE '94440' OR cp LIKE '94370' OR cp LIKE '94320' OR cp LIKE '94460' OR cp LIKE '94440' OR cp LIKE '94800' OR cp LIKE '94290' OR cp LIKE '94190' OR cp LIKE '94350' OR cp LIKE '94300' OR cp LIKE '94400' OR cp LIKE '95450' OR cp LIKE '95510' OR cp LIKE '95710' OR cp LIKE '95580' OR cp LIKE '95100' OR cp LIKE '95400' OR cp LIKE '95810' OR cp LIKE '95420' OR cp LIKE '95270' OR cp LIKE '95570' OR cp LIKE '95430' OR cp LIKE '95450' OR cp LIKE '95560' OR cp LIKE '95420' OR cp LIKE '95250' OR cp LIKE '95260' OR cp LIKE '95750' OR cp LIKE '95270' OR cp LIKE '95270' OR cp LIKE '95340' OR cp LIKE '95810' OR cp LIKE '95550' OR cp LIKE '95840' OR cp LIKE '95870' OR cp LIKE '95000' OR cp LIKE '95650' OR cp LIKE '95500' OR cp LIKE '95570' OR cp LIKE '95720' OR cp LIKE '95710' OR cp LIKE '95640' OR cp LIKE '95640' OR cp LIKE '95820' OR cp LIKE '95770' OR cp LIKE '95430' OR cp LIKE '95000' OR cp LIKE '95660' OR cp LIKE '95420' OR cp LIKE '95420' OR cp LIKE '95750' OR cp LIKE '95190' OR cp LIKE '95270' OR cp LIKE '95710' OR cp LIKE '95560' OR cp LIKE '95380' OR cp LIKE '95510' OR cp LIKE '95420' OR cp LIKE '95450' OR cp LIKE '95450' OR cp LIKE '95240' OR cp LIKE '95830' OR cp LIKE '95650' OR cp LIKE '95800' OR cp LIKE '95170' OR cp LIKE '95330' OR cp LIKE '95600' OR cp LIKE '95440' OR cp LIKE '95880' OR cp LIKE '95300' OR cp LIKE '95380' OR cp LIKE '95810' OR cp LIKE '95270' OR cp LIKE '95610' OR cp LIKE '95120' OR cp LIKE '95460' OR cp LIKE '95190' OR cp LIKE '95470' OR cp LIKE '95130' OR cp LIKE '95450' OR cp LIKE '95830' OR cp LIKE '95740' OR cp LIKE '95530' OR cp LIKE '95690' OR cp LIKE '95450' OR cp LIKE '95140' OR cp LIKE '95420' OR cp LIKE '95650' OR cp LIKE '95500' OR cp LIKE '95190' OR cp LIKE '95450' OR cp LIKE '95810' OR cp LIKE '95410' OR cp LIKE '95450' OR cp LIKE '95640' OR cp LIKE '95780' OR cp LIKE '95640' OR cp LIKE '95690' OR cp LIKE '95220' OR cp LIKE '95300' OR cp LIKE '95420' OR cp LIKE '95290' OR cp LIKE '95850' OR cp LIKE '95280' OR cp LIKE '95690' OR cp LIKE '95270' OR cp LIKE '95300' OR cp LIKE '95450' OR cp LIKE '95380' OR cp LIKE '95270' OR cp LIKE '95560' OR cp LIKE '95420' OR cp LIKE '95850' OR cp LIKE '95580' OR cp LIKE '95640' OR cp LIKE '95670' OR cp LIKE '95420' OR cp LIKE '95810' OR cp LIKE '95180' OR cp LIKE '95630' OR cp LIKE '95540' OR cp LIKE '95720' OR cp LIKE '95570' OR cp LIKE '95650' OR cp LIKE '95370' OR cp LIKE '95680' OR cp LIKE '95360' OR cp LIKE '95160' OR cp LIKE '95770' OR cp LIKE '95560' OR cp LIKE '95260' OR cp LIKE '95640' OR cp LIKE '95590' OR cp LIKE '95690' OR cp LIKE '95640' OR cp LIKE '95000' OR cp LIKE '95590' OR cp LIKE '95270' OR cp LIKE '95420' OR cp LIKE '95420' OR cp LIKE '95520' OR cp LIKE '95620' OR cp LIKE '95450' OR cp LIKE '95340' OR cp LIKE '95480' OR cp LIKE '95350' OR cp LIKE '95130' OR cp LIKE '95720' OR cp LIKE '95270' OR cp LIKE '95000' OR cp LIKE '95590' OR cp LIKE '95380' OR cp LIKE '95650' OR cp LIKE '95700' OR cp LIKE '95340' OR cp LIKE '95450' OR cp LIKE '95350' OR cp LIKE '95770' OR cp LIKE '95510' OR cp LIKE '95420' OR cp LIKE '95210' OR cp LIKE '95320' OR cp LIKE '95270' OR cp LIKE '95310' OR cp LIKE '95390' OR cp LIKE '95470' OR cp LIKE '95110' OR cp LIKE '95640' OR cp LIKE '95200' OR cp LIKE '95450' OR cp LIKE '95270' OR cp LIKE '95230' OR cp LIKE '95470' OR cp LIKE '95150' OR cp LIKE '95450' OR cp LIKE '95810' OR cp LIKE '95500' OR cp LIKE '95450' OR cp LIKE '95810' OR cp LIKE '95760' OR cp LIKE '95500' OR cp LIKE '95490' OR cp LIKE '95470' OR cp LIKE '95510' OR cp LIKE '95270' OR cp LIKE '95510' OR cp LIKE '95450' OR cp LIKE '95570' OR cp LIKE '95380' OR cp LIKE '95510' OR cp LIKE '95840' OR cp LIKE '95400' OR cp LIKE '95720' OR cp LIKE '95420' GROUP BY annonces.date ORDER BY date DESC

Le problème vient du tas de "OR cp LIKE 'xxx')

Comment puis je remplacer ça de manière optimale ??? Sachant que la liste des CP est générée en PHP suite à des calculs relativement complexes.

Merci de votre aide

Posté

Salut,

Normalement, like est fait pour trouver des chaînes similaires, or là tu testes en fait une série d'égalité (sur les codes à 5 chiffres), et de véritables "recherches du sous-chaînes" sur les like avec des %.

Je te conseille donc de regrouper tous les codes postaux à 5 chiffres pour lesquels tu testes une égalité dans un

OR cp IN ('12345', '23456' ...)

Je pense que la recherche ensembliste devrait être nettement plus rapide. Dis nous ce qu'il en est.

Posté

- essayes avec un cp IN('95270', '95510', '95400', ....) ça permettra peut être à l'optimisateur interne de faire des raccourcis.

- je trouve étrange que tes condition de jointure ne soient pas en premier dans la liste des critères du WHERE. Essayes de les passer en premier, généralement Mysql se dépatouille mieux

- vérifies que le champ annonces.date est bien un "char(5) binary" et pas un simple varchar(5)

- met bien NOT NULL partout ou c'est possible

- fais passer le activated en ENUM ou au BINARY

- fais passer les champs texte et vachar en BINARY si tu n'as pas besoin d'une recherche insensible à la casse

- si possible essayes de faire passer ton schéma de table "annonces" en statique au lieu de dynamique (élimines les varchar() et char() puis changes le statut via une interface d'admin)

Sinon, as tu mis des bons index ?

- code postal est-il en index ?

- activated est-il en index ?

- annonces.id_souscategorie ?

etc.

Avec des bons index tu peux diviser le temps par 1000 facilement si tu n'avais rien auparavant. Tous les critères principaux devraient être en index à priori.

Sinon à partir de MySQL 4.0 tu as un cache de requête intégré qui peut probablement éviter de répéter trop de fois la requête si elle est excessivement gourmande.

L'autre idée c'est de réduire le nombre de jointures. Il faudrait plus de précision sur tes données mais peut être que tu peux faire une requête rapide sur une table de façon à extrèmement filtrer, puis refaire une requête sur le reste des tables avec les identifiants de la première.

Parfois ça réduit de beaucoup les temps de traitement sur Mysql.

Posté

merci, la solution était en effet d'utiliser IN('') :)

je vais mettre des index en plus histoire d optimiser encore plus !

Merci de votre aide

Veuillez vous connecter pour commenter

Vous pourrez laisser un commentaire après vous êtes connecté.



Connectez-vous maintenant
×
×
  • Créer...