Announcement

Announcement Module
Collapse
No announcement yet.

sql dilemma

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • sql dilemma

    Hi,
    I've an important implementation choice to make regarding my application database.
    I have to choose a solution to the following problem:

    I've got two tables, one containing all the users of my application and another containing all the actions made by this users.
    Every time a user loads or reloads the home page i've to make a query to get the first 10 actions made by his "friends" (something like the facebook's timeline) .

    The problem is :
    is much more heavy to join the tables every time to retrieve all the infos that i need in both the tables respecting the relational theory or to replicate the data that i need from the user table in the action table beeing not so relationally correct?

    Consider that the target of this platform is between 50000 and 100000 users.

    Thank you for the help!

  • #2
    I don't fully understand your question, but it sounds like you don't need a join at all. You already know the user's ID. Just put that into the WHERE clause and query actions made by his friends.

    Comment

    Working...
    X