chill117 / express-mysql-session

A MySQL session store for the express framework in node
MIT License
313 stars 106 forks source link

Db/index on session #126

Closed goors closed 3 years ago

goors commented 3 years ago
chill117 commented 3 years ago

I don't understand the need for this. The session_id column is already a primary key.

goors commented 3 years ago

Wired thing is that select * from session where session_id= is super slow and is is reported in log as slow query. After adding index it is fast as expected. I use aws mysql 8.x. So i am not really sure. It was strange to me as well because I see it is primary key. My app after adding index started working normally.