-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(spans): Fix requests table span indexed perf (#76604)
### Summary This changes the condition so that 'span.module:http' on the requests table (and any other request that filters on a known category) uses a condition that clickhouse can recognize in order to do indexed span lookups, instead of the existing transform which misses the index. Should be multiple times faster after this change. #### SnQL This simplifies the filtering when using known (non "Other") categories with `span.module:` **Query before** ``` 'query': 'MATCH (spans) SELECT sentry_tags[status_code] AS ' '`span.status_code`, op AS `span.op`, span_id AS `id`, project_id AS ' "`project.name` WHERE if(in(op, array('db.redis', 'db.sql.room')), " "transform(op, array('db.redis', 'db.sql.room'), array('cache', " "'other'), 'other'), transform(sentry_tags[category], array('cache', " "'db', 'http', 'queue', 'resource'), array('cache', 'db', 'http', " "'queue', 'resource'), 'other')) AS `span.module` = 'other' AND " "ifNull(sentry_tags[status_code], '') = '200' AND timestamp >= " "toDateTime('2024-05-29T15:03:43.573039') AND timestamp < " "toDateTime('2024-08-27T15:03:43.573039') AND project_id IN " 'array(4554597948391425) LIMIT 101 OFFSET 0 ``` **Query after** ``` 'query': 'MATCH (spans) SELECT sentry_tags[status_code] AS ' '`span.status_code`, op AS `span.op`, span_id AS `id`, project_id AS ' "`project.name` WHERE sentry_tags[category] = 'http' AND " "ifNull(sentry_tags[status_code], '') = '200' AND timestamp >= " "toDateTime('2024-05-29T15:06:35.906113') AND timestamp < " "toDateTime('2024-08-27T15:06:35.906113') AND project_id IN " 'array(4554597959663617) LIMIT 101 OFFSET 0', ```
- Loading branch information
Showing
6 changed files
with
74 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters