[MDEV-27795] run sysbench with stored procedure Created: 2022-02-10 Updated: 2023-09-27 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Stored routines |
| Fix Version/s: | 10.5, 10.6 |
| Type: | Task | Priority: | Major |
| Reporter: | Axel Schwenke | Assignee: | Axel Schwenke |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Epic Link: | Stored Routine Performance |
| Description |
|
Chose a sysbench workload and implement it once with and once without a stored predure. Pull flame graphs for comparison. |
| Comments |
| Comment by Axel Schwenke [ 2022-02-16 ] | ||||||||||||||||||||||||||||||||||
|
I have picked sysbench workloads point-select and OLTP 90:10 for this. The procedures are created by the sysbench prepare stage and look like so. For MariaDB:
And for PostgreSQL:
Rem1: the cludge with SELECT INTO was used to make the CALL statement work with sysbench. As of now only a SELECT statement is expected to return a result set. Rem2: if multiple tables are used in sysbench, a precedure is created for each of them. This saves us from meddling with dynamic SQL. With these new workloads, we can compare performance and flame graphs for PG/MariaDB using procedures or not and using prepared statements or not (exception: PostgreSQL cannot prepare CALL statements). | ||||||||||||||||||||||||||||||||||
| Comment by Axel Schwenke [ 2022-02-17 ] | ||||||||||||||||||||||||||||||||||
|
I uploaded 4 results. Workloads point-select (a single statement in the procedure, like show above) and OLTP 90:10 using this procedure (MariaDB variant only)
In both PostgreSQL and MariaDB the one-line procedure doesn't work well. Sending the query alone is faster, especially as prepared statement. For the more complex 90:10 workload things look different. In MariaDB the peak throughput nearly doubles and for PostgreSQL the troughput even increases by a factor of more than 3 (compared to non-prepared queries). Interestingly calling the procedure with a prepared statement has negative impact on performance (PostgreSQL doesn't even support that). Numbers again:
|