mysql - User always appear to be online? -
mysql - User always appear to be online? -
i'm regularly updating lastly activity of each user on actions in order able online users later. when run query below, me result if user online :
select * info last_activity + interval 30 sec > now() , for_whom = '1461' , is_deleted=0
i tried alter last_activity column value lower time, row returned. ?
please create sure you're updating lastly activity mysql's now()
, not explicit datetime source.
also, query much faster if create index on info (for_whom, is_deleted, last_activity)
, rewrite query little:
select * info for_whom = 1461 , is_deleted = 0 , last_activity > now() - interval 30 sec
mysql phpmyadmin
Comments
Post a Comment