Jump to content

[SOLVED] Which of these methods are faster, are their better methods?


rxbanditboy1112

Recommended Posts

By fast I mean in milliseconds which will take less to process.

 

Let's say I am making a mailing list and many many user can create their own mailing lists.

Now is it faster to put all email addresses in 1 huge table and categorize them by who a user_id number of which they belong to. Then when some wants to send an email the algorithm will loop through all the email addresses with user_id numbers.

 

Or would it be more efficient to give each member their own table of email address. Of course the table will need to be looked up, however, there will be no need sort through thousands maybe millions of email address belonging to other users.

 

I suppose the 2nd method would be more efficient? Is there a faster method? If you have the name of a table (perhaps in this case it'd be the user_id number followed by mailing_list (example: 1230202mailing_list) does this provide instant access, or in the background is there a search performed to find the table with the given name.

Oh that is a helpful link.

 

Let's take another example where normalization isn't possible. Myspace has thousands of comment posts constantly. How would a site like that arrange things like comments so that they are quick to retrieve. Wouldn't the search time be outrageous?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.