Skip to content

Commit

Permalink
server: use stats activity tables on sql stats endpoint
Browse files Browse the repository at this point in the history
With the new sql stats tables that contain the top 500 rows
based on most used column, this PR updates the calls on the
sql stats endpoint to use the new flow:

```mermaid
flowchart TD;
    A[Compare the TS on ACTIVITY Table with the Requested TS] --> B{Is the requested time period completely on the table?}
    B -- Yes --> C[SELECT on ACTIVITY table]
    C --> D{Had results?}
    D -- Yes --> E[Return RESULTS]
    D -- No --> F[SELECT on PERSISTED table]
    B -- No ----> F
    F --> G{Had results?}
    G -- Yes --> E
    G -- No --> H[SELECT on COMBINED table]
    H --> E
```

Part Of: #101948

A following PR will deal when selecting a column that is not
one of the ones selected to generate the activity tables.

Release note (performance improvement): SQL Activity endpoints
now use first a table with the top data for the most used cases. If there
is no data available, it used the previous flow with persisted data and
if that is also empty, uses in-memory.
  • Loading branch information
maryliag committed Apr 25, 2023
1 parent 10665f9 commit 17128ce
Show file tree
Hide file tree
Showing 2 changed files with 420 additions and 139 deletions.
Loading

0 comments on commit 17128ce

Please sign in to comment.