PHP MySQL Charts/Graphs

From: CHYRON (DSMITHHFX) 8 May 2013 10:54
To: ANT_THOMAS 35 of 47
Might you not speed it up with fewer samples? Every minute seems excessive (maybe you needed that for developing/debugging).
From: CHYRON (DSMITHHFX) 8 May 2013 10:57
To: Drew (X3N0PH0N) 36 of 47
That choked my dual core 2.5g.
From: ANT_THOMAS 8 May 2013 11:29
To: CHYRON (DSMITHHFX) 37 of 47
There isn't really any developing/debugging as such. I've been playing with temperature sensors with my RPis and I wanted to put one outdoors and I decided it would be nice to look at the data in a graph. Every minutes is definitely overkill but it's very quick when I access the data locally, I think it would be slow even if the data was held on the hosting server, especially when it gets to weeks and months worth of data.
From: af (CAER) 8 May 2013 19:22
To: CHYRON (DSMITHHFX) 38 of 47
At that rate, 24 hours' worth is only 60k or so – 1440 data points per series, which is not a huge amount, and like I said earlier, even my phone can handle that with no noticeable slowing.
From: koswix 8 May 2013 23:29
To: Drew (X3N0PH0N) 39 of 47
No drop shadow! :O
From: ANT_THOMAS 9 May 2013 00:46
To: Matt 40 of 47
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: 9 May 2013 00:48 by ANT_THOMAS
From: ANT_THOMAS 9 May 2013 00:47
To: ALL41 of 47
I suck at using the new editor.
From: Matt 9 May 2013 06:57
To: ANT_THOMAS 42 of 47
Yes, an index would be useful there.
From: af (CAER) 9 May 2013 11:07
To: ANT_THOMAS 43 of 47
The editor sucks at being used, more like.
From: ANT_THOMAS 9 May 2013 11:34
To: Matt 44 of 47
Is it a cache issue that is causing no grey box to appear when I want to add code in the new editor? Only "code:" appears I end up having to go in to the HTML and put things between the pre tags but there's divs all over the place.
From: Matt 9 May 2013 13:17
To: ANT_THOMAS 45 of 47
Could be a cache issue, it's showing here on both "Teh Forum" and "Yellow" themes.
From: Drew (X3N0PH0N)14 May 2013 06:24
To: ALL46 of 47
Another slightly irrelevant cool thing: http://ankane.github.io/chartkick/
From: Isa (IZA_MUSED)17 Dec 2013 18:45
To: ANT_THOMAS 47 of 47
Ant- What a cool/interesting thing to do.
Is your questioned answered?  I imagine so by now, but don't have time to read.