Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1042182 Initial commit of trace tree blog post #28

Merged
merged 1 commit into from
May 8, 2024

Conversation

sfc-gh-tmonk
Copy link
Collaborator

No description provided.

@sfc-gh-tmonk sfc-gh-tmonk requested a review from a team as a code owner May 7, 2024 00:26
@sfc-gh-tmonk sfc-gh-tmonk force-pushed the tmonk-SNOW-1042182-blog-with-streamlit branch from 70177ad to 26e62e4 Compare May 7, 2024 23:59
select trace['trace_id'] as trace_id
from {FULLY_QUALIFIED_TABLE}
where 1=1
and resource_attributes['snow.query.id'] ilike '{query_id}%'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: let's make this query more constrained, and use something faster than ilike. IIUC this query will have to scan the entire event table, which may take a lot of time. Using something like lower(resource_attributes['snow.query.id']) = '{query_id}' may speed it up (I'm not really sure if will allow the query engine to skip FDN files, but it may be worth checking). We'll lose ability to enter partial query ids but IMHO it's acceptable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sfc-gh-alitouka Based on our conversation, I'm changing this to a case sensitive prefix query using startswith which seems to be a bit faster.

@sfc-gh-tmonk sfc-gh-tmonk force-pushed the tmonk-SNOW-1042182-blog-with-streamlit branch from 26e62e4 to 3767398 Compare May 8, 2024 17:52
@sfc-gh-tmonk sfc-gh-tmonk merged commit e066333 into main May 8, 2024
5 checks passed
@sfc-gh-tmonk sfc-gh-tmonk deleted the tmonk-SNOW-1042182-blog-with-streamlit branch May 8, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants