Basically, its a tracking page for clicks on microsites. There are 2 sql statements on the page to get the data sorted.
The first
Code: Select all
SELECT Count(tbltracking.LID)
FROM tbltracking
WHERE CID = '1127' AND tbltracking.LID <> '0';The second gets a selection of data based on which page and the number of items per page that are selected. For the example page 1 with 100 records is shown.
Code: Select all
SELECT tbltracking.CID, tbltracking.RID,tbltracking.LID, Count(tbltracking.LID), tbllinks.LinkName
FROM tbltracking INNER JOIN tbllinks
ON tbltracking.LID = tbllinks.LID
WHERE CID = '1127' AND tbltracking.LID <> '0' GROUP BY tbltracking.RID LIMIT 0,100If the data return is relative small, 100's or 1000's of records then the page works perfectly, but we have one client that has massive traffic so their tracking generates data in 10's of thousands if not more. In their case the page always timeouts without returning the data.
Can anyone suggest how I can optimise this in some way so that no matter the recordset size the data can be returned.
It's confusing the hell out of me, as I though the LIMIT command would mean only 100 records were present at any one time, therefore there should be no timeout...
Thanks in advance