#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    Join Table Performance


    Hi all,
    Is it a big performance issue when i am joining my table to "virtual table"?
    Example:
    Select * From TableA as A
    LEFT JOIN (Select * FROM TABLE A as B
    LEFT JOIN TABLEC as C on B.ID =C.ID)as JoinedBC on A.ID=JoinedBC.ID
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,296
    Rep Power
    7170
    Relatively speaking, yes it is, because the database engine doesn't have any indexes on the virtual table.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,026
    Rep Power
    4210
    you need a better example, because JoinedBC.ID is ambiguous

    besides, in general the optimizer is smarter than you think
    r937.com | rudy.ca
    please visit Simply SQL and buy my book

IMN logo majestic logo threadwatch logo seochat tools logo