[ODBC-120] slow performance on querys with large number of result rows Created: 2017-11-13  Updated: 2021-03-05  Resolved: 2018-11-04

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.0.2
Fix Version/s: 2.0.16, 3.0.3

Type: Bug Priority: Major
Reporter: David Thompson (Inactive) Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

centos7 with ColumnStore 1.1 or Server 10.2.9


Attachments: File orders50k.tbl.gz    

 Description   

There appears to be a significant overhead in query and returning results when using ODBC. I can reproduce this on both windows and unix but using unix here.

Create the following orders table:

create table orders (
        o_orderkey bigint,
        o_custkey int,
        o_orderstatus char (1),
        o_totalprice decimal(12,2),
        o_orderdate date,
        o_orderpriority char (15),
        o_clerk char (15),
        o_shippriority int,
        o_comment varchar (79)
) ;
 
load data local infile 'orders50k.tbl' into table orders;

test data attached gzipped

In my case using a separate VM as the ODBC client host.

Using isql piped to /dev/null:

# time echo "select * from orders" | isql centos > /dev/null
 
real    0m3.553s
user    0m3.484s
sys     0m0.010s

using same with mysql odbc:

# time echo "select * from orders" | isql mycentos > /dev/null
 
real    0m0.767s
user    0m0.728s
sys     0m0.007s

with mysql client:

# time mysql -u root -h 172.21.21.6 -vvv test -e "select * from orders" > /dev/null
 
real    0m0.122s
user    0m0.081s
sys     0m0.006s

I can understand some overhead of ODBC but ours seem large and is not as good as mysql community driver performance?

Config:

# cat /etc/odbcinst.ini
[mariadb]
Description=Maria DB
Driver64=/usr/lib64/libmaodbc.so
 
[MySQL]
Description     = ODBC for MySQL
Driver64        = /usr/lib64/libmyodbc5.so
 
 
# cat /etc/odbc.ini
[centos]
Driver=mariadb
Server=172.21.21.6
Database=test
Port=3306
User=root
Password=
 
[mycentos]
Driver=MySQL
Server=172.21.21.6
Database=test
Port=3306
User=root
Password=



 Comments   
Comment by Lawrin Novitsky [ 2017-11-19 ]

I found the cause, and have tentative fix. However, it breaks some functionality(some testcases fail). Thus it will take some more time

Comment by Lawrin Novitsky [ 2017-11-23 ]

The fix has been pushed to odbc-3.0 branch.
Not closing this report, as some other use scenarios(i.e. array fetch) may have similar performance issues, and can be optimized. Or maybe I will open separate ticket

Comment by David Thompson (Inactive) [ 2017-11-28 ]

The fix on average looks good to me, certainly addresses the massive discrepency. More specifically on dbt3/tpch orders table with 50k rows the mariadb driver is faster than mysqls. With a wider table (the lending club data) we are slight slower but in the same ballpark.

Comment by Lawrin Novitsky [ 2018-11-04 ]

I have opened separate ticket(ODBC-196) for similar possible issues

Generated at Thu Feb 08 03:26:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.