Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
benchmarking compare to other drivers show different things :
|--------------|--------------|--------------|--------------|
|
| c | c | odbc | odbc |
|
| mysql | mariadb | mariadb | mysql |
|
------------------------------------------------------|--------------|--------------|--------------|--------------|
|
select 1000 rows - TEXT | 5693 | 99% | 5766 | 100% | 2501 | 43% | 2356 | 41% | |
select 1000 rows - BINARY EXECUTE ONLY | 6548 | 100% | 6529 | 100% | 2186 | 33% | 2263 | 35% | |
------------------------------------------------------|--------------|--------------|--------------|--------------|
|
binary resultset parsing is slower than text parsing. there is no reason for that.
odbc code :
ret = SQLExecute(stmt);
|
if (!SQL_SUCCEEDED(ret)) { |
check_error(stmt, SQL_HANDLE_STMT, "Execute SELECT 1000 rows failed"); |
}
|
|
SQLBIGINT id;
|
SQLCHAR val[101]; |
while (SQLFetch(stmt) == SQL_SUCCESS) { |
SQLGetData(stmt, 1, SQL_C_SBIGINT, &id, 0, NULL); |
SQLGetData(stmt, 2, SQL_C_CHAR, val, sizeof(val), NULL); |
}
|
|
SQLCloseCursor(stmt);
|
text :
SQLAllocHandle(SQL_HANDLE_STMT, conn.dbc, &stmt);
|
|
SQLRETURN ret = SQLExecDirect(stmt, (SQLCHAR*)"SELECT * FROM test100", SQL_NTS); |
if (!SQL_SUCCEEDED(ret)) { |
check_error(stmt, SQL_HANDLE_STMT, "SELECT 100 int cols failed"); |
}
|
|
SQLINTEGER values[100]; |
if (SQLFetch(stmt) == SQL_SUCCESS) { |
for (int i = 0; i < 100; i++) { |
SQLGetData(stmt, i + 1, SQL_C_SLONG, &values[i], 0, NULL); |
}
|
}
|
|
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
|