Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ You can identify a Consecutive DB Queries problem by four main aspects in the "S
- Starting Span - The first span in a set of consecutive spans
- Parallelizable Spans - The spans that can be parallelized
- Duration Impact - The fraction of time added to the total transaction time as a result of spans not being ran in parallel
- Waterfall Trace View - Shows the parent span in which the consecutive DB queries occurred

![Consecutive DB Queries span evidence](./img/span-evidence.png)

View it by going to the **Issues** page in Sentry, selecting your project, clicking on the Consecutive DB Queries error you want to examine, then scrolling down to the "Span Evidence" section in the "Details" tab.
View it by going to the **Issues** page in Sentry, selecting your project, clicking on the Consecutive DB Queries error you want to examine, then scrolling down to the "Span Evidence" section.

## Example

Expand All @@ -55,8 +56,6 @@ processMyData({ result, count });
This results in a consecutive DB performance issue. You'll notice these queries occur sequentially in the span tree,
but they aren't interdependent because the result of one doesn't affect the other. Therefore, they can be executed in parallel.

![Consecutive DB Queries example](./img/consecutive-example.png)

To fix this performance issue, you could use Promise.all():

```javascript
Expand All @@ -68,5 +67,3 @@ processMyData({ result, count });
```

This makes the queries execute in parallel, which in this case, reduced the transaction duration by almost half!

![Consecutive DB Queries solved](./img/parallel-example.png)
Loading