---
# System prepended metadata

title: Benchmark Node trackers

---

# Benchmark Node trackers

* Timing is in Milliseconds
* Sql request in staging are not logged in the console

## SearchNodeTrackersInStock

```csharp=
        this.Query
            .Include(tracker => tracker.Snapshot)
            .Where(
                tracker => tracker.Snapshot.StockId == stockId
                && tracker.NextVersionId == null
                && tracker.Snapshot.Status == Core.Enums.StockSnapshotStatus.COMMITED)
            .Include(tracker => tracker.Node)
            .OrderBy(tracker => tracker.Node.Name);
```
#### Dev

``` SQL
      SELECT [n].[Id], [n].[CreationTime], [n].[CreatorUserId], [n].[DeleterUserId], [n].[DeletionTime], [n].[IsDeleted], [n].[LastModificationTime], [n].[LastModifierUserId], [n].[NextVersionId], [n].[NodeId], [n].[PrevVersionId], [n].[SnapshotId], [s].[Id], [s].[CreationTime], [s].[CreatorUserId], [s].[LastModificationTime], [s].[LastModifierUserId], [s].[NextSnapshotId], [s].[PrevSnapshotId], [s].[Status], [s].[StockId], [s].[TriggerRunId], [d].[Id], [d].[BlobName], [d].[CreationTime], [d].[CreatorUserId], [d].[LastModificationTime], [d].[LastModifierUserId], [d].[Name], [d].[RunId], [d].[Size], [d].[Status]
      FROM [NodeTrackers] AS [n]
      INNER JOIN [StockSnapshots] AS [s] ON [n].[SnapshotId] = [s].[Id]
      INNER JOIN [DataNodes] AS [d] ON [n].[NodeId] = [d].[Id]
      WHERE ([n].[IsDeleted] = CAST(0 AS bit)) AND ((([s].[StockId] = @__stockId_0) AND ([n].[NextVersionId] IS NULL)) AND ([s].[Status] = 3))
      ORDER BY [d].[Name]
      OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY
```
* Time: 104

#### Staging

* Time: 996

## SearchNodeTrackersInSnapshot

### Specification Version

```csharp=
        this.Query
            .Where(tracker => tracker.SnapshotId == snapshotId)
            .Include(tracker => tracker.Node)
            .OrderBy(tracker => tracker.Node.Name);

```

#### Dev

``` SQL
      SELECT [n].[Id], [n].[CreationTime], [n].[CreatorUserId], [n].[DeleterUserId], [n].[DeletionTime], [n].[IsDeleted], [n].[LastModificationTime], [n].[LastModifierUserId], [n].[NextVersionId], [n].[NodeId], [n].[PrevVersionId], [n].[SnapshotId], [d].[Id], [d].[BlobName], [d].[CreationTime], [d].[CreatorUserId], [d].[LastModificationTime], [d].[LastModifierUserId], [d].[Name], [d].[RunId], [d].[Size], [d].[Status]
      FROM [NodeTrackers] AS [n]
      INNER JOIN [DataNodes] AS [d] ON [n].[NodeId] = [d].[Id]
      WHERE ([n].[IsDeleted] = CAST(0 AS bit)) AND ([n].[SnapshotId] = @__snapshotId_0)
      ORDER BY [d].[Name]
      OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY
```
* Time: 169

#### Staging

* Time: 3902

### LinQ Version

```csharp
IQueryable<NodeTrackerQueryResponse> tmp = from tracker in this._dbContext.NodeTrackers
                                                   where tracker.SnapshotId == snapshotId
                                                   join node in this._dbContext.DataNodes
                                                   on tracker.NodeId equals node.Id
                                                   orderby node.Name
                                                   select new NodeTrackerQueryResponse { Tracker = tracker, Node = new() };
```

#### Dev

``` SQL
      SELECT [n].[Id], [n].[CreationTime], [n].[CreatorUserId], [n].[DeleterUserId], [n].[DeletionTime], [n].[IsDeleted], [n].[LastModificationTime], [n].[LastModifierUserId], [n].[NextVersionId], [n].[NodeId], [n].[PrevVersionId], [n].[SnapshotId]
      FROM [NodeTrackers] AS [n]
      INNER JOIN [DataNodes] AS [d] ON [n].[NodeId] = [d].[Id]
      WHERE ([n].[IsDeleted] = CAST(0 AS bit)) AND ([n].[SnapshotId] = @__snapshotId_0)
      ORDER BY [d].[Name]
      OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY
```
* Time: 64

#### Staging

* Time: 2235