Piwik 1.7b : ts_archived in piwik_archive_numeric

Hi, I am using piwik instead of php-stats since few days.
In my forum I display some stats like unique visitors, pages views etc… about “yesterday”

So I made a sql query using piwik_archive_numeric"yesterday"
It works, there no problems about it, but In this table I saw there was a lot of useless lines. There is several same lines like “nb_uniq_visitors” with the same date but not the same value. And with “ts_archived” wich is not the same.

I use a cron job every hours and sometimes I use the android app.

Why does it archive it ? one per day is enough, am I missing something ?


These extra “useless” rows should be deleted after 2 days maximum. If after more than 3 or 4 days you still see these rows please post a reply here with a screenshot showing the old lines (with increasing visits, ie. that were processed during that day) not deleted!


yes that’s right! these rows are deleted now.
But I don’t know if I use the right table to display these stats in my forum…
I use this “archived_numeric” to make a short sql request because the value is already displayed.

I mean, if I don’t watch my stats everyday will it archive the “yesterday” stats ?

Here is my request:

$datehier= date('Y-m-d', strtotime('-1 day'));
$moishier= date('Y_m', strtotime('-1 day'));

$query = "SELECT value FROM piwik_archive_numeric_".$moishier." WHERE name = 'nb_visits' AND date1 = '" . $datehier . "' AND date2 = '" . $datehier . "' ORDER BY piwik_archive_numeric_".$moishier.".value DESC LIMIT 1";