Reputation: 13
my team uses SQL database for generating "daily active user" report the size of the table we search is about 7 million records, and we tried our best to optimize our algorithm, and put index on SQL db, but still got 120 secs for each daily report generating.
is there any way to make it faster?
any fields/keywords/books/forums that any one could recommend I could search for?
detail information
query definition:
for an user who has logged in for consecutive 7 days we counted it as "active user" at the end of 7 days
table: login_in
record basic info for login, logout time, account id
programming language: java with seam framework
SQL db: MySQL
many thx in advance!!
Upvotes: 1
Views: 974
Reputation: 35048
The first step would be to do an EXPLAIN
on the query that is driving the report. This can provide clues as to which part of the query are slow. You want to make sure that all parts of the query are covered by an index rather than full table access.
See docs for EXPLAIN
Upvotes: 2