SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    issue with select from multiple tables

    I have a query that selects from four tables,
    and it's to run on the home page, so each time
    the site is visited, the query runs, Iím worried
    about performance and the stress a lot of traffic
    will put on the server, Iím not a db expert,
    is there a way to optimize things and put less stress
    on the server and improve performance?

    Is an implied JOIN less efficient than an explicit JOIN
    (like I read somewhere)?

    Again, there is a link to a second page which runs the same
    query as on the home page, is there a way to pass the result
    of the first query along without re-running the query?(Using
    query string is out of the answer).

    Many thanks.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,022
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by tentim View Post
    ...is there a way to optimize things and put less stress
    on the server and improve performance?
    optimize your query to use indexes

    alternatively, cache the query results

    alternatively, you could cache the entire page



    Quote Originally Posted by tentim View Post
    Is an implied JOIN less efficient than an explicit JOIN
    (like I read somewhere)?
    no it isn't, and whoever wrote that it is doesn't understand how it works



    Quote Originally Posted by tentim View Post
    ... is there a way to pass the result
    of the first query along without re-running the query?(Using
    query string is out of the answer).
    i think you meant out of the question

    yes, try caching the query results
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks man.

    i think you meant out of the question
    Yeah. That was a little play on words.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •