How fetching data from MSSQL can be increased>
-
@M-H-H said in How fetching data from MSSQL can be increased>:
I used ODBC and it is slow. I didn't find any example for SQL Native Client. ( Qt does not support this type of connection. )
I am aware of this! I just drew your attention to the fact that ODBC is likely slower than SQL Native Client would be, and hence a possible factor in your tests, though you can't alter that from Qt.
One obvious observation might be: if speed is a concern, why use MSSQL if you are on a single PC? And if you are using it across a network, then it might well be faster, and at least more secure, than SQLite?
BTW, are you using the "forward only" parameter where you can, e.g. doing
SELECT
s? I found this had a considerable speed up at least for MySQL, if you're not using where appropriate for MSSQL it's worth a try to see if you improve? -
Use another database like e.g. PostgreSQL which is better supported will maybe help :)
-
@JonB
I use 'where' in my SQL script to speed up and reduce the amounts of records that are required. Actually, the SQL command runs very fast but getting the result in a loop is the problem. For example, in C# you can get the result in bulk which helps to reduce the overhead.
Also, I use indexing to improve the performance which helps a lot. -
Blame the ODBC driver :)
-
@Christian-Ehrlicher
Thanks for your mention.
I might check MySQL instead of PostgreSQL. -
@M-H-H But then you have to compile the Qt plugin by your own due to licensing issues. Use a database where you don't have such problems.
-
@Christian-Ehrlicher
Indeed.👍