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

Fix duplicated queries on multiple connections #1385

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

February30th
Copy link
Contributor

Fixes duplicated query count when running same sql statement on multiple connections.

@taylorotwell taylorotwell marked this pull request as draft September 22, 2023 15:01
@crynobone
Copy link
Member

Hi @February30th

To avoid any confusion, can you provide an example where this can cause an issue?

@February30th
Copy link
Contributor Author

Fetching activity log of multiple databases:

SELECT * FROM activity_log; // connection: db-1
SELECT * FROM activity_log; // connection: db-2

The queries get flagged as duplicated, despite running in two different databases, which is not accurate.

@crynobone
Copy link
Member

crynobone commented Sep 25, 2023

How does it handle the following?

SELECT * FROM activity_log; -- connection: db-1
SELECT * FROM activity_log; -- connection: db-1
SELECT * FROM activity_log; -- connection: db-1
SELECT * FROM activity_log; -- connection: db-2
SELECT * FROM activity_log; -- connection: db-2

@zhoubiaobiao

This comment has been minimized.

@February30th
Copy link
Contributor Author

5 duplicated queries, should be 3 duplicated queries (2 on connection db-1) and 1 duplicated query on db-2

@crynobone

This comment was marked as outdated.

@crynobone
Copy link
Member

crynobone commented Sep 25, 2023

5 total queries, and 3 duplicated queries (2 on connection db-1) and 1 duplicated query on db-2

This make sense.

@crynobone crynobone marked this pull request as ready for review September 25, 2023 11:25
@taylorotwell taylorotwell merged commit 81e16d0 into laravel:4.x Sep 25, 2023
10 checks passed
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.

4 participants