A MySQL question.
Due to there being missing parts on the chart for the shorter readings because of the missing entries I've changed how the data is pulled from the database by calculating the current time minus the length of time required then only fetching the rows that are greater than this calculated time. It works nicely and gives a proper day, week length etc.
My question is should I be indexing my "unixtime" column to make it easier on the DB?
New code is...
code:
$currtime = time();
$newlimit = $currtime - $limit;
SELECT * FROM outside WHERE unixtime > $newlimit ORDER BY id DESC
With $limit now being the length of time in seconds.
edit: I think that looks better.
EDITED: 8 May 2013 23:48 by ANT_THOMAS