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. How to optimize Hash Match aggregation in SQL Server execution plan

How to optimize Hash Match aggregation in SQL Server execution plan

Scheduled Pinned Locked Moved Database
sharepointdatabasesql-serversysadmincryptography
2 Posts 2 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.
  • K Offline
    K Offline
    kali siddhu
    wrote on last edited by
    #1

    How to optimize Hash Match aggregation in SQL Server execution plan for the below

    SELECT ServicePointID, MAX(SP1.StartDayID) as StartDayID FROM SP sp1 JOIN Transfr tr1 ON sp1.TransformerID = tr1.TransformerID --Hash Match JOIN SP_Met spm1 ON spm1.ServicePointKey = sp1.ServicePointKey JOIN Met dm1 ON dm1.MeterKey = spm1.MeterKey WHERE sp1.StartDayID <= 20200715 AND sp1.EndDayID >= 20200616 AND sp1.CommodityType ='Electric'AND (tr1.Division = null OR NULL is null ) AND (tr1.Region = null OR NULL is null )AND MeterID IS NOT NULL GROUP BY ServicePointID Hash Match Aggregation 34%

    L 1 Reply Last reply
    0
    • K kali siddhu

      How to optimize Hash Match aggregation in SQL Server execution plan for the below

      SELECT ServicePointID, MAX(SP1.StartDayID) as StartDayID FROM SP sp1 JOIN Transfr tr1 ON sp1.TransformerID = tr1.TransformerID --Hash Match JOIN SP_Met spm1 ON spm1.ServicePointKey = sp1.ServicePointKey JOIN Met dm1 ON dm1.MeterKey = spm1.MeterKey WHERE sp1.StartDayID <= 20200715 AND sp1.EndDayID >= 20200616 AND sp1.CommodityType ='Electric'AND (tr1.Division = null OR NULL is null ) AND (tr1.Region = null OR NULL is null )AND MeterID IS NOT NULL GROUP BY ServicePointID Hash Match Aggregation 34%

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Execution plan is depending on multiple factors. How to optimize? Get rid of excess colunms, get red of the date-constriction, get rid of region. Best idea; find a damn programmer.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

      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