What is the differnece in the table names of GS and HS?

My9to5 261 Reputation points
2021-01-20T18:58:53.427+00:00

Something i've found:

Views displaying current inventory data are named v_GS_<group name>.
Views displaying inventory history data are named v_HS_<group name>.

Although that makes sense, I'd like to understand deeper.

  1. Are all tables mirrored between the two?
  2. At what point does GS (current) move to HS (Historical)?

When I write my SQL, should I be including both?

Microsoft Security | Intune | Configuration Manager | Other
0 comments No comments
{count} votes

Accepted answer
  1. Garth Jones 2,076 Reputation points
    2021-01-20T19:48:02.863+00:00
    1. No they are not mirrored pre se. Only history data will show in the history views.
    2. They move from current to history when details are changed/removed/added. aka if you currently have 16gb of ram on Oct 1 2020 this will be the current value until it changes. On Jan 20 2021 you go to 32 GB of RAM, it will become the new current and the old value will be add to history and will stay for ~90 days.
    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Garth Jones 2,076 Reputation points
    2021-01-20T19:49:11.177+00:00

    When I write my SQL, should I be including both

    It depend on what you are trying to do BUt IMO 95% of the time NO, there is no use for history data.

    1 person found this answer helpful.
    0 comments No comments

  2. AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
    2021-01-21T06:14:42.7+00:00

    @My9to5
    Thank you for posting in Microsoft Q&A forum.
    Like Garth said, in most cases, we only use the current inventory data with the name v_GS_<group name>.
    We seldom use the inventory history date, for example, if we want to check if there any change for client computer disk size, we may include both v_GS_DISK and v_HS_DISK like below:

    SELECT DISTINCT  
      RV.Netbios_Name0 as 'Pc Name',  
      RV.User_Domain0 as 'User Name',  
      GD.DeviceID0 as 'Device ID',  
      GD.Size0 as 'Current HD Size',  
      HD.Size0 as 'Historic  HD Size'  
    FROM  
      dbo.v_R_System_Valid RV  
      INNER JOIN v_GS_DISK GD ON RV.ResourceID = GD.ResourceID  
      INNER JOIN v_HS_DISK HD ON RV.ResourceID = HD.ResourceID  
    WHERE  
      GD.Size0 <> HD.Size0 and GD.DeviceID0 = HD.DeviceID0   
    

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.