Skip to content

Sentry detects N+1 queries in server side cursorΒ #6576

@sk-

Description

@sk-

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.61.1

Steps to Reproduce

We recently updated from sentry 2.57.0 to 2.61.1 and we started getting many reports of N+1 queries in the Sentry UI. This was tracked to PR #6252.

In our particular case, we use sqlalchemy with asyncpg and the queries that are being flagged are all due to the use of server side cursors.

Our code is as follows:

await conn.stream(query)

Is there any workaround? Should we just disable the AsyncPGIntegration if using sqlalchemy?

Expected Result

No N+1 queries should be detected when using conn.stream.

Actual Result

Lot of flagged N+1 queries in Sentry's UI

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status
    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions