Powershell execution time

Welcome Forums General PowerShell Q&A Powershell execution time

This topic contains 2 replies, has 3 voices, and was last updated by

3 years, 5 months ago.

  • Author
  • #30589

    Points: 0
    Rank: Member

    Hello all,

    I am at a "dead end" with my powershell script. It executes correctly but it takes to long to execute. (about 7days since it does millions of DML operations on a SQL Server Database).
    Problem is the 7 days it takes isn't acceptable and i need to reduce it to 2 days at max...

    Can anyone point me on where i can start looking to solve this?
    Would post the whole code but its around 600 lines.



  • #30596

    Points: 1
    Rank: Member

    The first thing to determine if the time is taken up by the PowerShell script itself or if the script is waiting for the SQL commands to complete. Is the SQL server/database the bottleneck.

    It may also be the type of SQL command used, INSERT vs BULK INSERT
    In SELECT statements, are some of the key variables indexed?
    Those would also be factors.

  • #30597

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    It's probably not possible to give you specific advice without the code, and for a 600-line script, it's going to be difficult for a volunteer to find that kind of time ;).

    Do you think that it's mainly the SQL portion that's causing the long time? If so, that's really a query optimization or SQL Server optimization problem, and this isn't probably the right place to find answers for that. It could be anything from a poorly designed schema, to badly designed indexes, to indexes needing maintenance, to a thousand other things.

The topic ‘Powershell execution time’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort