I don't know where this session tables comes from, but as a DB expert, I would suggest just putting an index on the 'last_activity' field. That would speed up the searches in the tables (if it isn't already indexed).
Apr 29, 2015
2
Level 2
Session queries are taking a long time
Hello,
I noticed through NewRelic that laravel seems to be performing session cleanup queries on my pages. It's hard to tell if it is happening on every page or certain pages.
But when it does, it seems to be very slow. My sessions are configured to last for 100 days and are stored in the database. Here's a snip from NewRelic showing the query time.

Any idea how to make this faster?
Thanks.
Level 1
Please or to participate in this conversation.