[phpOpenTracker-general] range problem
"Sergio Bayona" <[email protected]> Sat, 07 May 2005 02:11:58 +0000
| Newsgroups | gmane.comp.web.phpopentracker.general |
|---|---|
| Message-ID | <20050506.jHP.11299000@localhost> |
Hi,
I am doing the following,
$top_docs_total = phpOpenTracker::get(
array(
'api_call' => 'top',
'what' => 'document',
'range' => 'total',
'limit' => 5
)
);
and I was under the impression that "total" meant every record ever stored on
the DB and it seems that's not the case. The reason I say this is because the
SQL query seems to be getting only the table for May (which has no data) and
it isn't including the tables from previous months. Please have a look at the
SQL and tell me if I am wrong.
CREATE TEMPORARY TABLE pot_temporary_table SELECT data_table.string AS item
FROM pot_accesslog_200505 accesslog,
pot_visitors_200505 visitors,
pot_documents data_table
WHERE visitors.client_id = '1'
AND visitors.accesslog_id = accesslog.accesslog_id
AND data_table.data_id = accesslog.document_id
GROUP BY visitors.accesslog_id,
data_table.string
table:
visitors type:
system possible_keys:
PRIMARY,client_time key:
key_len:
ref:
rows:
1 Extra:
Using temporary
table:
accesslog type:
range possible_keys:
accesslog_id,document_id key:
accesslog_id key_len:
4 ref:
rows:
4 Extra:
where used
table:
data_table type:
eq_ref possible_keys:
PRIMARY key:
PRIMARY key_len:
4 ref:
accesslog.document_id rows:
1 Extra:
2 0.005503000000 SELECT COUNT(item) AS total_items,
COUNT(DISTINCT(item)) AS unique_items
FROM pot_temporary_table
table:
pot_temporary_table type:
ALL possible_keys:
key:
key_len:
ref:
rows:
4 Extra:
3 0.003248000000 SELECT COUNT(item) AS item_count,
item
FROM pot_temporary_table
GROUP BY item
ORDER BY item_count DESC,
item LIMIT 5
table:
pot_temporary_table type:
ALL possible_keys:
key:
key_len:
ref:
rows:
4 Extra:
Using temporary; Using filesort
4 DROP TABLE pot_temporary_table
Any help would be greatly appreciated,
Sergio