21 reputation
2
bio website
location
age
visits member for 8 months
seen Mar 25 at 1:07
stats profile views 1

Sep
21
awarded  Custodian
Sep
10
comment Friends relations in MySQL
Thank you. I'll check that links. I will keep benchmarking and trying different methods to reach the best.
Sep
10
comment Friends relations in MySQL
I have replaced friendid-key to unique key (friendid,userid) and now results are about .00794 Is this as fast as it can get? Looking at the results do you think the first way is better (one row for each relation)? Because it's twice as less space than the second one and results are about the same with current setups.
Sep
10
comment Friends relations in MySQL
After a bunch of tests, I'll change table settings, add different indexes as you suggested.
Sep
10
comment Friends relations in MySQL
I have made some tests to see how fast is the current setup. I haven't changed the tables' scheme. First query 1,000,000 rows (user table) 2,045,007 rows (friends table - one row for each relation. Friendships are created randomly for 10.000 users) First query takes 0.01094 seconds to return 600 rows. Same query changed with UNION takes 0.0086 to return 600 rows. Second query 1,000,000 rows (user table) 4,048,781 rows (friends_twoway table - two rows for each relation) The second query in my first post takes 0.0090 sec. to return 600 rows. What do you think about these results?
Sep
10
reviewed Approve suggested edit on Friends relations in MySQL
Sep
10
awarded  Student
Sep
10
asked Friends relations in MySQL