Sub Queries Optimization

  • (SELECT Column1

    FROM Table1) as --5

    Table1_1

    ON table3.Column1  = Table1_1.Column1

    LEFT JOIN

    (SELECT Column1

    FROM Table1 

    GROUP BY Column1) As --6

    Table1_2

    ON Table1_1.Column1 = Table1_2.Column1

    Could you Please let us know how to optimize above sub Queries

  • Your code looks incorrect at the top.

    Short answer: Index on column1 for the tables, as this will lower the amount of data you search.

    Longer answer, please provide better DDL and some data along with where you find a problem or what doesn't work well.

  • We definitely need more information, because, as currently written, the second table is completely unnecessary.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply