Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4.31, 10.11.5, 10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4
-
None
-
RHEL 8
Description
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using:
CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS |
SELECT
|
H1.`id` AS `historyId`, H1.`uId` AS `uId`, H1.`jobTitleId` AS `jobTitleId`, H1.`joinedDate` AS `joinedDate`, |
H1.`eDate` AS `eDate`, H1.`eventId` AS `eventId`, HE.`name` AS `eventName` |
FROM ( |
(`History` H1
|
LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) |
) JOIN ( |
SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` |
FROM ( |
(
|
SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` |
FROM `History` |
) SH1
|
JOIN ( |
SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` |
FROM ( |
SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` |
FROM `History` |
) TMP
|
WHERE TMP.`eDate` <= curdate() |
GROUP BY TMP.`uId` |
) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) |
)
|
GROUP BY SH1.`uId` |
) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) |
);
|
This has become a blocker for our application.
Attachments
Issue Links
- is caused by
-
MDEV-27510 Query returns wrong result when using split optimization
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: {{CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) );}} This has become a blocker for our application. |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: {{ CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); }} This has become a blocker for our application. |
Description |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: {{ CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); }} This has become a blocker for our application. |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); This has become a blocker for our application. |
Description |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); This has become a blocker for our application. |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: {code:sql} CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); {code} This has become a blocker for our application. |
Description |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: {code:sql} CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); {code} This has become a blocker for our application. |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: {code:sql} CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); {code} This has become a blocker for our application. |
Summary | Perfromance Degradation of Joins on VIEWs after some changes | Perfromance Degradation of Joins on VIEWs after v10.4.22 |
Status | Open [ 1 ] | Needs Feedback [ 10501 ] |
Attachment | 2023115--feedback--01.txt [ 72488 ] |
Attachment | 2023115--feedback--01.txt [ 72488 ] |
Attachment | 20231115--feedback--01.txt [ 72489 ] |
Description |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: {code:sql} CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT * FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); {code} This has become a blocker for our application. |
We tried upgrading current 10.4.22 to the next version and discovered that an existing VIEW used in JOIN takes more than 45mins to return the results. But in 10.4.22 we're getting the results within 8 seconds for 25000 records. We discovered the same behavior with recent 10.4.31 and 10.11.5 too.
Below is the VIEW we're using: {code:sql} CREATE DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `vRecord` AS SELECT H1.`id` AS `historyId`, H1.`uId` AS `uId`, H1.`jobTitleId` AS `jobTitleId`, H1.`joinedDate` AS `joinedDate`, H1.`eDate` AS `eDate`, H1.`eventId` AS `eventId`, HE.`name` AS `eventName` FROM ( (`History` H1 LEFT JOIN `HistoryEvent` HE ON (HE.`id` = H1.`eventId`) ) JOIN ( SELECT SH1.`uId` AS `uId`, MAX(SH1.`id`) AS `id` FROM ( ( SELECT `id`, `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) SH1 JOIN ( SELECT TMP.`uId` AS `uId`, MAX(TMP.`eDate`) AS `eDate` FROM ( SELECT `uId`, IFNULL(`eDate`, '1970-01-01') AS `eDate` FROM `History` ) TMP WHERE TMP.`eDate` <= curdate() GROUP BY TMP.`uId` ) SH2 ON (SH1.`uId` = SH2.`uId` and SH1.`eDate` = SH2.`eDate`) ) GROUP BY SH1.`uId` ) H2 ON (H1.`uId` = H2.`uId` and H1.`id` = H2.`id`) ); {code} This has become a blocker for our application. |
Status | Needs Feedback [ 10501 ] | Open [ 1 ] |
Status | Open [ 1 ] | Needs Feedback [ 10501 ] |
Status | Needs Feedback [ 10501 ] | Open [ 1 ] |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] | |
Fix Version/s | 11.3 [ 28565 ] | |
Fix Version/s | 11.4 [ 29301 ] |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] | |
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.11 [ 27614 ] | |
Affects Version/s | 11.0 [ 28320 ] | |
Affects Version/s | 11.1 [ 28549 ] | |
Affects Version/s | 11.2 [ 28603 ] | |
Affects Version/s | 11.3 [ 28565 ] | |
Affects Version/s | 11.4 [ 29301 ] |
Labels | regression |
Link |
This issue is caused by |
Assignee | Igor Babaev [ igor ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Attachment | 20240210--analysis--MariaDB-10.4.22.txt [ 73111 ] | |
Attachment | 20240210--analysis--MariaDB-10.11.5.txt [ 73112 ] |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.3 [ 28565 ] |
Fix Version/s | 10.4 [ 22408 ] |
Fix Version/s | 11.1 [ 28549 ] |
Fix Version/s | 11.2(EOL) [ 28603 ] |
Fix Version/s | 11.7 [ 29815 ] |
Fix Version/s | 11.7(EOL) [ 29815 ] |
Assignee | Igor Babaev [ igor ] |
Assignee | Sergei Petrunia [ psergey ] |
Priority | Critical [ 2 ] | Major [ 3 ] |