$res1=mysql_query('select id, feed_title, feed_detail, feed_image, pub_date from link_feeds where rss_id=' . $id . ' order by id desc' . $nrec . ''); which query turns into: select id, feed_title, feed_detail, feed_image, pub_date from link_feeds where rss_id=249 order by id desc limit 0,8 On first load on page I get slow time... after $res1=mysql_query('select id, feed_title, feed_detail, feed_image, pub_date from link_feeds where rss_id=' . $id . ' order by id desc' . $nrec . ''); = Processed:0.393Memory:389920 other queries, few diff stuff after, final total loading time for box all the way through the while($row1=mysql_fetch_assoc($res1)) with above time is = Processed:0.395Memory:389920 ---- there is about 16 diff boxes so it matters... If you refresh the page they all load in .001...I do the query by itself always get .001 or less.... What am I doing wrong? Thanks.
On any subsequent loads the php will be cached, so the php interpreter won't need to lookup all the symbols again.
Judging by your previous posts, I think that the database size is what's slowing it down, assuming that this is the same one as before.
yes the db has about 1.2 million records, but that cant change... I am not sure why this query is taking 8 seconds to load. There is about a 1.2 million records in link_feeds. There are indexes on: with cardility ID PRIMARY 1193287 rss_id INDEX 5473 pub_date INDEX 596643 hits INDEX 389 titleindx INDEX 1193287 feed_url INDEX 1193287 EXPLAIN SELECT id, feed_title, feed_detail, feed_image, pub_date FROM link_feeds WHERE rss_id =2 ORDER BY id DESC LIMIT 25 [ Edit ] [ Skip Explain SQL ] [ Create PHP Code ] id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE link_feeds ref rss_id rss_id 2 const 4105 Using where; Using filesort I am not sure, your help is greatly appreciated thanks! This is puzzling..
puffyz I thought you said the query always takes the same time regardless? If that is the case then obviously this is a PHP issue, not a SQL one.