after a few days of hacking and an OS change to linux we got numbers like this
and this number is with 400k sensordata and 1.3 million sensordata_properties entries in our database.
queries
one of the great things about using a database is the ability to run queries. here are a couple that i just wrote:
this one gets all the data sensor data from today.
select * from sensordata, hackyuser
where hackyuser.email='emailaddress@hackystat.org'
and sensordata.owner_id = hackyuser.id
and resource like '%fooProject%'
and tstamp > current_date
this one gets the exact snapshots per day
select date_trunc('day', runtime), tool, max(runtime) from (
select distinct runtime, tool from sensordata, hackyuser
where hackyuser.email='emailaddress@hackystat.org'
and sensordata.owner_id = hackyuser.id
and resource like '%fooProject%'
) runtime_tool
group by date_trunc('day', runtime), tool
order by date_trunc('day', runtime)
(formatted output)
"2008-06-27" "2008-06-27 00:39:33.458" "Checkstyle"
"2008-06-27" "2008-06-27 00:40:02.802" "JavaNCSS"
"2008-06-27" "2008-06-27 00:39:41.145" "JUnit"
"2008-06-27" "2008-06-27 00:39:58.63" "PMD"
"2008-06-27" "2008-06-27 00:40:09.834" "SCLC"
"2008-06-29" "2008-06-29 14:15:26.607" "Checkstyle"
"2008-06-29" "2008-06-29 12:27:54.546" "JavaNCSS"
"2008-06-29" "2008-06-29 12:27:44.89" "JUnit"
"2008-06-29" "2008-06-29 12:27:53.062" "PMD"
"2008-06-29" "2008-06-29 12:27:57.156" "SCLC"
the totally awesome thing is that even though there is hundreds of thousands of entries we can execute these queries in less than a second. its totally fast.
issues
there are always issues; here are a couple
select relname, n_live_tup, last_analyze
from pg_stat_user_tables
where relname like '%'
this is really fast, but is an estimate because the stats could be out of date.
thats it for now. things seem to be all good with the sensorbase. at least for now.
1 comment:
You're not allowed to use FTW. You don't even game!!!
Post a Comment