[MDEV-23293] Stored procedure having just one plain insert stmt takes 10 times longer that executing same insert directly Created: 2020-07-25 Updated: 2020-11-15 Resolved: 2020-11-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Shamim | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | need_feedback | ||
| Environment: |
mariadb in ubuntu |
||
| Description |
|
I have created a stored procedure which has just one insert statement to a table which takes 10 times longer to execute as compared to sending the exact same insert statement executed using mariadb client. I am calling the stored procedure from a python program. Tested the same insert SQL directly executing from python program. It takes one second to do 50 inserts (row) by calling stored procedure each time |
| Comments |
| Comment by Marko Mäkelä [ 2020-07-27 ] |
|
shamim.ahmad@nttdata.com, can you please provide more details, such as:
|
| Comment by Shamim [ 2020-07-27 ] |
|
Following the maraidb version, i am using: mariadb -V I will post here in next comments the DDL, DML, i am using |
| Comment by Shamim [ 2020-07-27 ] |
|
Following is the create table, DDL: CREATE TABLE `MIS` ( Below is the insert stmt, using dummy data here: insert into MIS (PNAME, PID, ANO, STUID, SOUID, FNAME, DUP, MD5) values ('pname123', '123', '567', '280.100.12345.98765', '1.2.3.100.200.300.1', 'file1.001', NULL, 'JSKJKS98978979KJKJKJKJ'); |
| Comment by Shamim [ 2020-07-27 ] |
|
Exact same insert, i am using in stored procedure which takes 10 time longer to complete execution: Initially i suspected "START Transaction", row level locking for select/updates... then i removed all those business logic from stored procedure, and just used one plain insert stmt, just to test the performance, and found this issue. |
| Comment by Shamim [ 2020-07-27 ] |
|
My application is written in python, i will put some code snippets here for SP call versus insert's SQL execution. |
| Comment by Elena Stepanova [ 2020-10-17 ] |
|
Any luck with the code snippets? I can't reproduce the described effect so far. |