Sample Header Ad - 728x90

Sessionizing Web Log Data using MySQL (perhaps by simulating window functions)

1 vote
1 answer
107 views
I have a large MySQL Table containing about 15 Million rows of web log data. Depending on the IP, useragent and site_id (different sections on the website) I want to create user sessions. The session delimiter should be 30 minutes. So if a unique user (same IP and useragent) is inactive for 30 minutes or if he visits a different site area (2, 3, or 4) a new session starts. I found a very good blog entry, that describes the general procedure: http://randyzwitch.com/sessionizing-log-data-sql/ But I can't implement this 1:1 because MySQL doesn't support window functions and I'm not proficient enough with MySQL to figure it out on my own, e.g. with GROUP_CONCAT(). Here is anonymized example data on sqlfiddle: http://www.sqlfiddle.com/#!9/a8b1f/1 It would be really great if you could help me. I already posted this question on Stack Overflow .
Asked by LarsVegas (55 rep)
Nov 6, 2015, 08:48 AM
Last activity: Nov 10, 2015, 12:56 AM