Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Inner join vs two select statements

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #36745

    Hey peeps!

    Not so much a php problem, more of a general SQL performance question.

    So i’ll have two tables, one with say user information with a unique userID, and another table with all other kinds of meta-data along with which user created it (the userID again).

    Now, when i want to display the username of the person (which is in the user-table) based off the userID in the meta-data table:
    Would i be better off using an inner join statement fetching the data i need from the users table, or just do it say via a php function that returns me a username based off of a userID (essentially another db-query)?

    It’s not really gonna be huge amounts of traffic, i’m just sort of wondering what the best approach would be performance-wise anyways.

    Cheers for now!

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.