[MXS-3841] LIMIT should be added for each select query automatically Created: 2021-10-28 Updated: 2022-02-14 Resolved: 2022-01-12 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | maxgui |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Nilnandan Joshi | Assignee: | Duong Thien Ly |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Sprint: | MXS-SPRINT-148 |
| Description |
|
Whenever run select * from table if user specify any limit option then its fine if user does not specify any limit option then it should take default limit value and then it should go to DB. |
| Comments |
| Comment by Duong Thien Ly [ 2021-10-29 ] |
|
toddstoffel I assign it to you, so you can rank priority and determine which version it should be. |
| Comment by Naresh Chandra [ 2021-11-03 ] |
|
If we run a select query without limit option, against to big table is causing DB slowness, so please make sure that auto limit option should be added before hitting to the DB. |
| Comment by Naresh Chandra [ 2021-11-15 ] |
|
Can we have a quick fix for this issue, at least in the next release? We are planning to give it to the other development teams but since its a production DB, without fixing this bug, we can't give it to them. Can you please check on this bug and make it forward to the next release would be good? So that we will plan accordingly. Thanks in advance. |
| Comment by Naresh Chandra [ 2021-11-22 ] |
|
Can we fix this in the next release please ? |
| Comment by Duong Thien Ly [ 2021-11-23 ] |
|
Hi Naresh, the bug for preview data without specifying LIMIT is fixed in 6.2.0 which would probably be released soon. However, to automatically inject the LIMIT clause to every statement that is written by the user in the SQL editor, that required us to refactor the way we implemented and that takes time to consider. |
| Comment by Naresh Chandra [ 2021-11-23 ] |
|
Hi Duong, Thanks for the update. |
| Comment by Naresh Chandra [ 2021-12-08 ] |
|
Seems this is not fixed in the 6.2.0 version, can we take-up this issue in the next release version would be very helpful. So, that we can plan for the Production environment. |
| Comment by Duong Thien Ly [ 2021-12-09 ] |
|
toddstoffel, I think we can have this for the 6.3 release. Though this's not trivial, to enforce the LIMIT clause to every statement, we need to split the query into statements which is the hardest part as we need to handle the use of DELIMITER. |
| Comment by Naresh Chandra [ 2021-12-17 ] |
|
Hi Todd, Can you please take up this as a priority would be very helpful for us, as long as its not fixed then we cant use the SQL editor till it get fixed for Production. Please give priority to this issue. |
| Comment by Naresh Chandra [ 2022-01-04 ] |
|
Hi Todd, Can you please take up this as a priority, as long as its not fixed then we cant use the SQL editor till it get fixed for Production. Please give priority to this issue. |
| Comment by Duong Thien Ly [ 2022-01-10 ] |
|
naresh.chandra@copart.com We have https://mariadb.com/docs/reference/mdb/system-variables/sql_select_limit/, would this solve your issue? |
| Comment by Naresh Chandra [ 2022-01-10 ] |
|
Hi Duong, Thanks for the update. Please implement in the Maxscale would be good for us. |
| Comment by Duong Thien Ly [ 2022-01-10 ] |
|
Would it be okay if we internally implement current "Max rows" value to behave like `sql_select_limit` i.e. when `Max rows` value changes, it internally execute `SET sql_select_limit= new_max_rows` ? |
| Comment by Naresh Chandra [ 2022-01-10 ] |
|
Hi Duong, Not sure, but can you confirm whether this option automatically add limit to the select query? or after fetching the total rows then it will filter with this option? can you confirm on this? For example: Then If I use this option then, will it scan/read all the 100 Million rows then return 10 rows or will it directly scan/read first 10 rows and then return 10 rows. I have below queries Can you please test all the above scenarios, if I miss anything then add other scenarios test it and if works fine then we are good. 2. It should work with read only user and should be work with PAM user(AD authentication). 3. it should work pagination like first page 1 - 1000, next pagination 1000 - 2000 something like that. so that first time it will hit and fetch 1 to 1000 records and 2nd time it will hit and fetch 1000 to 2000 records like that. |
| Comment by Duong Thien Ly [ 2022-01-10 ] |
|
naresh.chandra@copart.com, since `sql_select_limit` is already implemented in the server, can you open a support ticket for the usage of the `sql_select_limit`? Some of our support engineers will help you clarify it. Thank you |
| Comment by Naresh Chandra [ 2022-01-10 ] |
|
Hi Duong, I will request to MariaDB Team but below things needs to taken care by you, can you please check on the below points.? 1. If user specify limit option in the Query editor then how we can pass the query? |
| Comment by Duong Thien Ly [ 2022-01-10 ] |
|
naresh.chandra@copart.com,
|
| Comment by Naresh Chandra [ 2022-01-10 ] |
|
Hi Duong, Thanks for the update. Please go ahead and implement this option. If anything need then please refer the CASE(CS0371064) which we raised to MariaDB Team. Except SP, everything looks good. > 2. If its stored procedure how it works? sql_select_limit will not work for procedures (it is call() not select),. ******************************* CREATE PROCEDURE p2 ( ) DELIMITER ; |
| Comment by Duong Thien Ly [ 2022-01-11 ] |
|
Since we're going to make `max_rows` behave likes `sql_select_limit`, this seems to be a bug fix. So I'll change its type and the fix version. |
| Comment by Naresh Chandra [ 2022-01-11 ] |
|
Hi Duong, Thanks for the update. Any ETA for 6.2.1 Release ? can we expect this 6.2.1 release in this month? |
| Comment by Duong Thien Ly [ 2022-01-11 ] |
|
naresh.chandra@copart.com As far as I know, no ETA at the moment. |
| Comment by Naresh Chandra [ 2022-01-11 ] |
|
Hi Duong, Thanks for the update. |