Optimizing performance [SOLVED]
Posted: Mon Nov 03, 2008 3:45 pm
Hi, i'm doing a stat report for a client and the database is really taking a lot of time to compile the data. Its not complex data at all, i optimized the query from 22 secs to 13 secs but it's still very long.
Tables:
Stats_Requests (id, sys_date, sys_hour, sys_quarter, req_page, req_user, querystring)
Stats_Pages (id, hostname, path, moduleindex)
Stats_Users (id, sys_dateuser, ip2long, sessionkey)
All dates are integers
Links between tables: SR.req_page = SP.id, SR.req_user = SU.id
I need to produce a report of the number of visits on the site between two dates, per module (using moduleindex) and a number of pages seen. If possible in a fast way and in one query. I have been stumped so far as to do both counts in one single query. I think it's not possible but i'll keep trying while i wait for answers.
Thanks
Tables:
Stats_Requests (id, sys_date, sys_hour, sys_quarter, req_page, req_user, querystring)
Stats_Pages (id, hostname, path, moduleindex)
Stats_Users (id, sys_dateuser, ip2long, sessionkey)
All dates are integers
Links between tables: SR.req_page = SP.id, SR.req_user = SU.id
I need to produce a report of the number of visits on the site between two dates, per module (using moduleindex) and a number of pages seen. If possible in a fast way and in one query. I have been stumped so far as to do both counts in one single query. I think it's not possible but i'll keep trying while i wait for answers.
Thanks