database - Mysql - Creating a stub table that holds the Id's of certain rows in another table -


i'm working on project need have different kinds of users, victims , members. database should able support large amounts of records users, say, example 500k, it's reasonable grows larger.

currently have of these records stored in same table, "users", role field describes type of user is. table split in two, 1 victims , 1 members, having single table simplifies lot of other work on project.

for part, there higher number of victims members, makes querying victims not of deal, because of rows victims. however, when needing query members (especially things counting number of rows members) assume waste lot of time looking @ rows end not being ones want.

my solution create stub "members" table, hold id's of rows in user's table infact members, consisting of primary key + foreign key unsigned integer.

does solution mitigate amount of time take query members ? best solution ? again, i'm assuming splitting table 2 separate ones best option, , if that's reasonable way i'll choose one, having in same table fix bunch of other problems.

remember old days, when search engine "found 2,571,462 hits"? did believe number? number changed while reading it.

then got smart , said "about 2,570,000 hits". approximation. perhaps estimated algorithm or counted once day.

then came "over 2,000,000 hits".

and no mention.

i suggest can count once day, "about 1,234 members".

the lesson here... not technical problems can (or should) solved in code. should solved changing user's expectations.


Comments