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 5957399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:23:42+00:00 2026-05-22T18:23:42+00:00

We’d like to introduce a feature that lets users view game results by their

  • 0

We’d like to introduce a feature that lets users view game results by their Facebook friends. We currently store each user’s facebook uid when they first register for our game (social sign-on). Our MySQL DB looks something like this:

User

  • user_id
  • facebook_uid

Result

  • user_id
  • score
  • resultdate

Calling the Facebook Graph API, we can produce a comma delimited list friend uid’s. So one way to filter game results by facebook friends is to:

  1. run a sql IN clause on the User.facebook_uid field using the friend list, then
  2. join User.user_id to Result.user_id

We’ll test this, but I’m concerned about the performance impact of using IN clause (friend lists can be 300+).

Does anybody have experience using a different approach?

Would enjoy any insights. Thanks.

  • 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-22T18:23:43+00:00Added an answer on May 22, 2026 at 6:23 pm

    I never use user_id in my database. Although it would be an int(5) most likely – meaning faster, Having two id’s is simply confusing and you can run into issues like this.

    In my experience of developing Facebook apps (about 1 year and a half now) I never had issues using an IN statement, queries were always fast. As long as you have a good database arhitecture and good PHP code, you should be fine. It’s just a leaderboard afterall or similar.

    You can also load that info through an AJAX call so users will never experience delays due to long SQL queries.

    Another option is storing those friends for each user in a lookup table that you update everytime, but can be slightly innacurate and I think it’s too much effort for the purpose of this.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into

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.