Time-out problem
Hello!
I have 3 tables: spd_unit, spd_ad and spd_campaign.. I'm using Innodb, the index and fk relations are correct.
But the table spd_unit, have more them 2.000.000 rows... so the browser give me time-out error when I try to execute this block of code:
$campaigns = mysql_query('select id_campaign from spd_campaign');
while($campaingsA = mysql_fetch_array($campaigns)){
$formatQ = mysql_query('select fk_id_ad_format from spd_unit join spd_ad on fk_id_ad = id_ad where fk_id_campaign = '.$campaingsA['id_campaign'].' group by fk_id_ad_format');
while($formatA = mysql_fetch_array($formatQ)){
echo 'campaign --> '.$campaingsA['id_campaign'].' | format ->> '.$formatA['fk_id_ad_format'].'<br>';
}
}
In my application I use Yii Framework, where I created a function to run this query to a especific campaign passed by parameter... The code above is just a test that I made to test query speed. The time of execution is more than 3 minutes
Someone can help me with this?
Subject
Written By
Posted
Time-out problem
April 23, 2014 08:04AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.