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
  • 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-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

I have two tables in mysql: Results Table : 1046928 rows. Nodes Table :
I have two tables that I join sims and transactionlog and display in a
I have two tables that I'm joining (in order to get the username from,
Ok, I've got an interesting problem here. I have two tables, tips and votes.
I have two tables. One above the other. I want to move the bottom
I have two tables: events : id, name, date_from, date_to event_recurrences : id, event_id,
I have two tables in the database Team:Id(int PK), Name(nvarchar) and Player:Id(int PK), Name(nvarchar),
Ok, here we go... I have a select query accessing a very abstract database.
I am attempting to optimize a process for creating a SQL report based upon
I apologize in advance for the length, the solution may well be trivial, just

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.