parallel execution of CTAS statements

  • Hi,

    I have 10 CTAS statements creating temp tables. Once they are created, they are LEFT OUTER JOINED.

    Is there a way, a parallel execution of these 10 CTAS statements be enforced programmatically or does the Query optimiser engine take care of this automatically?

    thank you

  • etl2016 (2/9/2016)


    Hi,

    I have 10 CTAS statements creating temp tables. Once they are created, they are LEFT OUTER JOINED.

    Is there a way, a parallel execution of these 10 CTAS statements be enforced programmatically or does the Query optimiser engine take care of this automatically?

    thank you

    What are CTAS?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • hi, CTAS is create table as SELECT

    thank you

  • etl2016 (2/9/2016)


    hi, CTAS is create table as SELECT

    thank you

    The simplest way I can think of doing this is using an SSIS package to submit the queries in parallel via multiple ExecuteSQL tasks.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • That sounds like Oracle not SQL Server. SS doesn't have CTAS syntax.

    SQL DBA,SQL Server MVP(07, 08, 09) "Money can't buy you happiness." Maybe so, but it can make your unhappiness a LOT more comfortable!

  • ScottPletcher (2/9/2016)


    That sounds like Oracle not SQL Server. SS doesn't have CTAS syntax.

    Aha, I just assumed it was an unorthodox way of referring to SELECT INTO.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • ScottPletcher (2/9/2016)


    That sounds like Oracle not SQL Server. SS doesn't have CTAS syntax.

    It's SQL Server Parallel Data Warehouse aka APS, or the Azure version of it, Azure DWH. CTAS replaces SELECT ... INTO in the PDW.

    PDW is not a standard SQL Server, SSIS is not a good option for working on data within the PDW, because it doesn't take advantage of the distributed nature of the data, and it requires pulling the data out and putting it back in.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • etl2016 (2/9/2016)


    Is there a way, a parallel execution of these 10 CTAS statements be enforced programmatically or does the Query optimiser engine take care of this automatically?

    The CTAS statements will be executed one after each other. T-SQL is synchronous in terms of statement execution. Each one may run in parallel depending on the distribution of the data.

    The only way to make the CTAS statements run at the same time as each other would be multiple sessions each with one or more of the CTAS statements, but then you risk running into the concurrent query limit.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (2/9/2016)


    The CTAS statements will be executed one after each other. T-SQL is synchronous in terms of statement execution. Each one may run in parallel depending on the distribution of the data.

    CTAS needs to apply exclusive locks on system objects.

    While the first one is not finished no other ones would be able to start.

    _____________
    Code for TallyGenerator

Viewing 10 posts - 1 through 9 (of 9 total)

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