From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow queries in executable on Win8 Surface

Solved!
Go to solution

Having an issue with an executable using LV 2013 and connectivity toolkit.  The exe runs fine on my 32-bit Win7 machine and the code runs fine in development mode on Win 8 Surface.  Running as an EXE on the same Win 8 Surface is extremely slow (factor of 20 or so slower than development mode on either machine or EXE mode on Win7 machine). 

 

I see a variety of "have to do something special when making EXE using connectivity toolkit" posts but they are all <2006 and the EXE works fine on Win7 machine so I'm thinking they "something specials" are not required?

 

Pointing at a MySQL database as localhost. Database has ~15 tables and no table has more than 10k rows.  Not doing anything exotic in the queries and there are not a lot of them, as databases go. Multiple queries (but perhaps not all, I'm not sure)  involving different tables are slow.

 

Have tried (all to no effect):

       1] connecting to a remote MySQL instance with the same data

       2] recompiling the EXE

       3] restarting the Surface

 

Am in the process of trying a different Surface. Will also try compiling on the Surface (it is currently compiled on Win7-32 and moved to Win8-64 Surface).

 

 

Any thoughts?

 

0 Kudos
Message 1 of 4
(2,160 Views)

My first thought (because it recently happened to me) is to check that the MySQL connections are being closed/reused properly. It could be that the exe is running so much faster and creates too many connections to MySQL. Then the program needs to wait for MySQL connections to expire, slowing everything down.

I build web apps for LabVIEW
http://chrislarson.me
0 Kudos
Message 2 of 4
(2,117 Views)

Good thought.  I'll check.

 

I don't have any queries running in un-throttled loops (that I know of).  Mostly, it's a state machine that runs a half dozen simple queries, displays the data, and waits for user (without re-running to update data, etc.).

 

 

0 Kudos
Message 3 of 4
(2,103 Views)
Solution
Accepted by topic author Zwired1

Solved.  Turns out it was a combination of a bad connection string and non-escalated errors and multiple reconnect attempts. 

 

This was helpful; I'll post it here in the interest of sharing: https://www.connectionstrings.com/mysql-connector-odbc-5-2/  

0 Kudos
Message 4 of 4
(2,091 Views)