mysql - What Are Good Solutions for a Database Table that Gets to Long? -


i describe problem using specific scenario:

imagine create website towhich users can register, , after register, can send private messages each other.

this website enables every user maintain own friends list, , maintain blocked users list, prefers not messages.

now problem:

imagine website getting several millions of users, , imagine every user has 10 friends in friend table, , 10 blocked users in blocked users table.

the friends list table, , blocked users table, become long, worse that, every time when wants send message person "x", need go on whole blocked users table, , records user "x" defined - people blocked.

this "scanning" of long database table seems bit inefficient me.

so have 2 questions it:

1) possible solutions problem? not afraid of long database tables, afraid of database tables contain data many users, means whole table needs scanned every time, pull out few records specific user.

2) specific solution have in mind, , ask about:

one solution have in mind problem, every user registers website, have own "mini-database" created him, way friends table, blocked users table, contain only records him.

this makes scanning table easy, because records him.

does idea exist in databases ms-sql server, or mysql? , if yes, solution described problem? (each user have own small database created him, , of course there main (common) database other data not user specific)

thank all

i wait on partitioning , on creating mini-database idea. database installed data, log , temp files on different raid drives? have clustered indexes on tables , indexes on search , join columns?

have tried kind of reading query plans see how , slowdowns occurring? don't add memory or try advanced features blindly before doing basics.

creating separate databases become maintenance nightmare , challenging type of queries (for users....) in future.

partitioning wonderful feature of sql server , while in 2014 can have thousands of partitions (unless put each partition on separate drive) won't see big performance bump looking for.

sql server has fast response time tables (especially tables 10s of millions of rows (in case user table)). don't let main table wide , response time extremely fast.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -