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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:22:03+00:00 2026-05-18T08:22:03+00:00

Right now I have two tables for getting a timeline of posts that a

  • 0

Right now I have two tables for getting a timeline of posts that a user follows in MySQL, timeline and follows.

In the ‘follows’ table, there is the ‘follows.follow_From’ column, the ‘follows.follow_To’ columns to show where the follows are from.

In the timeline table, there is a ‘timeline.post_From’ column containing the author’s user ID of the post.

What is the most efficient method of selecting all posts from ‘timeline’ only where the current user has a “follow” in the ‘follows’ table? I am currently using a MySQL array, but I don’t see it as efficient. Thank you for reading this and your help!

  • 1 1 Answer
  • 3 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-18T08:22:04+00:00Added an answer on May 18, 2026 at 8:22 am

    I’m not an expert and it might not be the most efficient but I’d guess:

    1. SELECT follow_To FROM follows WHERE follow_From = ‘user-id’
    2. SELECT * FROM timeline WHERE timeline.post_From = (the results above)

    e.g. SELECT * FROM timeline WHERE timeline.post_From IN (SELECT follow_To FROM follows WHERE follow_From = ‘user-id’)

    Doing the other way round would definitely be slower because your processing more data then cutting it down. Cutting the data down first then look up is better.

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

Sidebar

Related Questions

Right now I have 3 tables: User, Roles, and User_Roles for the many-to-many association.
Right now I have a PHP file that does a MYSQL query and then
I have two tables on mysql: users, and management. The users table has a
I have two tables in mysql: Results Table : 1046928 rows. Nodes Table :
I just have a quick question about notation. I have two tables right now.
Say, I have two tables like these: Table group Table user +----+-----------+ +----+----------+------+----------+ |
Im getting very confused with indexes in MySQL. I have two tables: TableA1 and
Right now I have a simple two column table with z number of rows.
I actually have right now two questions: 1) What font faces are preferred for
Right now I have a script that will get the last five files in

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.