does this make sense? (optimally)
Posted: Thu Jul 31, 2003 2:14 pm
ok. so i'm making a rateme site. i think that's known.. well i wanna track who's actively online (like loaded a page in the last 5 min or such)
would creating a table with the following and then setting 0 for offline and 1 for online and touching it (setting online to 1) with every pageload make sense in an optimally speacking way, or is there a better way (other tables i have are: users (the main table which is checked on any page that is restricted access as well as logging in since it stores the pws with an md5 mask on them... all cookies are currently plaintext with a check that the username an pw match what's on record AND the username has permission to access the page when going to a restricted page), stats (holds members stats), comments (holds comments on members), bio (holds member bios), interests (holds member's interests), friends (entries used to create a member's friends list), votes (tracks who you've voted for.. will be manually reset once a month so that scores aren't changed by one person voting for him/herself 1000 times)):
tracking who's online
CREATE TABLE online(
username varchar(15) NOT NULL PRIMARY KEY,
last_page_load timestamp,
online tinyint(1) default '0' NOT NULL PRIMARY KEY
) TYPE=MyISAM;
or is there something else that would be better to optimize this?
would creating a table with the following and then setting 0 for offline and 1 for online and touching it (setting online to 1) with every pageload make sense in an optimally speacking way, or is there a better way (other tables i have are: users (the main table which is checked on any page that is restricted access as well as logging in since it stores the pws with an md5 mask on them... all cookies are currently plaintext with a check that the username an pw match what's on record AND the username has permission to access the page when going to a restricted page), stats (holds members stats), comments (holds comments on members), bio (holds member bios), interests (holds member's interests), friends (entries used to create a member's friends list), votes (tracks who you've voted for.. will be manually reset once a month so that scores aren't changed by one person voting for him/herself 1000 times)):
tracking who's online
CREATE TABLE online(
username varchar(15) NOT NULL PRIMARY KEY,
last_page_load timestamp,
online tinyint(1) default '0' NOT NULL PRIMARY KEY
) TYPE=MyISAM;
or is there something else that would be better to optimize this?