Category: Optimization

  • SQL Tips – Why LEFT JOINS are bad

    When you do SQL queries do you find yourself always, or almost always, using left joins?  If you’ve answered yes to this question, I would suggest to continue to read and understand some downfalls that you might be getting yourself into.

    Let’s start by looking at a standard query that has a left join:

    [code]
    SELECT * FROM users u LEFT JOIN countries c ON c.id = u.country_id WHERE u.id = 5
    [/code]

    The following query will return all fields from the users table and all fields from the countries table.  Now you’re thinking, “Yeah, looks good, so what’s wrong with this?”.  Well, I’m glad you asked. (more…)

  • YSlow – Helping slow web pages load faster

    This article is a continuation to my article about FirebugYSlow is an add-on to Firebug that helps developers determine why a site is loading slowly.

    After you install YSlow, if you open up Firebug in Mozilla a new tab will now appear called “YSlow”.  The next steps would be to load a web site that you want to check it’s performance.  After the web site has loaded, click the YSlow tab, if the results don’t compile automatically, click the Performance button to run the diagnostics.

    The grading is made up of 13 steps.  For each step you receive a grade from A to F.  An overall grade is compiled in the same format. (more…)