Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 298449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:43:58+00:00 2026-05-12T06:43:58+00:00

OK I have a social network, around 50,000 users so far and there is

  • 0

OK I have a social network, around 50,000 users so far and there is a friend table that show who is your friend on the site, this table is over a million rows

Not the tricky part, I show user posted bulletin, status posts, stuff like that that is only visible to people on your friend list.
Keep in mind the size of the tables, user table around 50,000 so far and friend table around 1 million

1 method of getting the friends list to know what status posts to show to a user is to run this query below and put the results into an array

select friendid from friend_friend where userid=1 and status=1

I would then turn this array into a comma seperated list and use it in an IN clause on the mysql query that fetches the posts that this user is allowed to view

Hope that makes sense so far.

Now what if I were to save this friend array to a session variable since this query is ran very frequently?
One of the drawbacks I see is if a user adds that person as a friend while they are logged in, they would show up as there friend until that session was reset but other then that, would this be bad performance for memory or whatever sessions use?

Also note there is sometimes up to 500 users logged in and some have a friend list of 10,000 friend ID’s and this is a PHP/MySQL setup

Another question about session data, it is stored in file and not sytem memory correct? If it is on disk instead of memory then memory shouldn’t be to much of a problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:43:58+00:00Added an answer on May 12, 2026 at 6:43 am

    maybe you would want to respond to this problem dynamically.

    if, let’s say, a user has more than X friends, don’t cache it. think of what could happen when a user has a lot of friends and you need to push the entire data through the connection… i think the user recognizes this as bigger performance reduction than the one when you need to query the list each time.

    this is my opinion based on my experience with php/mysql… maybe there’s a reason for doing what you proposed anyway^

    regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a social network The users table is around 60,000 rows The friends
I have a social network that allows users to write blogs and ask questions.
I have a social network that allows users to post blogs, ask questions, and
I have a social network that has a blogs and questions section. There are
I have a social network that allows users to choose fonts for their profiles.
I have a social network type site (member site) I store a lot of
I have created a Job Queue module that processes jobs and constructs social-network type
I have a social network site I have been working on for a couple
I have a social network for the cystic fibrosis community. There is a section
i'm running a social network site and i currently have most main user data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.