Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Is there a performance difference?

Is there a performance difference?

Scheduled Pinned Locked Moved Database
visual-studiocomtestingbeta-testingperformance
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #1

    between: SELECT * FROM Blah1 as T1 INNER JOIN Blah2 as T2 ON T1.ID=T2.ID INNER JOIN Blah3 as T3 ON T1.Id=T3.ID ; vs. SELECT * FROM Blah1 as T1 ,Blah2 as T2,Blah3 as T3 WHERE T1.ID=T2.ID AND T1.ID=T3.ID ; I've never really understood the advantage of the first syntax, and I'm always using the second syntax. Marc MyXaml Advanced Unit Testing

    G J S M 4 Replies Last reply
    0
    • M Marc Clifton

      between: SELECT * FROM Blah1 as T1 INNER JOIN Blah2 as T2 ON T1.ID=T2.ID INNER JOIN Blah3 as T3 ON T1.Id=T3.ID ; vs. SELECT * FROM Blah1 as T1 ,Blah2 as T2,Blah3 as T3 WHERE T1.ID=T2.ID AND T1.ID=T3.ID ; I've never really understood the advantage of the first syntax, and I'm always using the second syntax. Marc MyXaml Advanced Unit Testing

      G Offline
      G Offline
      Grimolfr
      wrote on last edited by
      #2

      The advantage of the first syntax is legibility. It visually and logically separates the evaluations that are specifically used to define the join(s) from the evaluations that are only used to filter the joined results.


      Grim

      (aka Toby)

      MCDBA, MCSD, MCP+SB

      Need a Second Life?[^]

      SELECT * FROM user WHERE clue IS NOT NULL GO

      (0 row(s) affected)

      1 Reply Last reply
      0
      • M Marc Clifton

        between: SELECT * FROM Blah1 as T1 INNER JOIN Blah2 as T2 ON T1.ID=T2.ID INNER JOIN Blah3 as T3 ON T1.Id=T3.ID ; vs. SELECT * FROM Blah1 as T1 ,Blah2 as T2,Blah3 as T3 WHERE T1.ID=T2.ID AND T1.ID=T3.ID ; I've never really understood the advantage of the first syntax, and I'm always using the second syntax. Marc MyXaml Advanced Unit Testing

        J Offline
        J Offline
        je_gonzalez
        wrote on last edited by
        #3

        If you have access to SQL Query Analyzer, type each statement and then Ctrl + L (Display Extimated Execution Plan). This will display what steps the server will do and when you move the mouse pointer over each step it will tell you the estimated cost in CPU cycles, using the database current stats.

        1 Reply Last reply
        0
        • M Marc Clifton

          between: SELECT * FROM Blah1 as T1 INNER JOIN Blah2 as T2 ON T1.ID=T2.ID INNER JOIN Blah3 as T3 ON T1.Id=T3.ID ; vs. SELECT * FROM Blah1 as T1 ,Blah2 as T2,Blah3 as T3 WHERE T1.ID=T2.ID AND T1.ID=T3.ID ; I've never really understood the advantage of the first syntax, and I'm always using the second syntax. Marc MyXaml Advanced Unit Testing

          S Offline
          S Offline
          Steven Campbell
          wrote on last edited by
          #4

          The first syntax is far superior in my mind, for the following reasons: 1) legibility 2) ease of maintenance - easily add/remove a join/condition 3) flexibility - it is easier to construct complex queries this way, especially those containing outer joins and/or complex joins. I do think it is possible that the 1st syntax will lead to better optimized queries, because it gives the optimizer explicit information on what is a join and what is part of the WHERE clause. In a simple query it probably makes no difference, but once the query becomes complex, I'm sure it helps the query optimizer to know these things. Final point on legibility - I usually write my queries something like this

          SELECT *
          FROM Blah1 as T1
          INNER JOIN Blah2 as T2 ON T1.ID=T2.ID
          INNER JOIN Blah3 as T3 ON T1.Id=T3.ID

          which is much more legible.


          my blog

          1 Reply Last reply
          0
          • M Marc Clifton

            between: SELECT * FROM Blah1 as T1 INNER JOIN Blah2 as T2 ON T1.ID=T2.ID INNER JOIN Blah3 as T3 ON T1.Id=T3.ID ; vs. SELECT * FROM Blah1 as T1 ,Blah2 as T2,Blah3 as T3 WHERE T1.ID=T2.ID AND T1.ID=T3.ID ; I've never really understood the advantage of the first syntax, and I'm always using the second syntax. Marc MyXaml Advanced Unit Testing

            M Offline
            M Offline
            Mike Ellison
            wrote on last edited by
            #5

            Hi all. For what it's worth, the WHERE clause syntax for creating joins was part of the ASNI SQL/86 standard. The INNER JOIN / OUTER JOIN syntax became part of the ASNI SQL/92 standard. In addition to the other comments made, the JOIN syntax also allows for more functionality, such as the FULL OUTER JOIN supported in some RDBMSs.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups