Page 1 of 1

Python variable to database frequent update at rate 20times

PostPosted: 27. July 2022 13:24
by amd123coep
My requirement is to update some value from python variable to mysql database.This has to happen 20-30times per minute

One way is put update query in loop...is there any other efficient way.
This is to keep record of trade values

Re: Python variable to database frequent update at rate 20ti

PostPosted: 27. July 2022 19:31
by Nobbie
amd123coep wrote:One way is put update query in loop...is there any other efficient way.


No, i have no idea. What are you thinking about? What do you mean by "efficient" and what is unefficient with a loop? Actually i dont know, what you are looking for.

I know, there is "prepared statement" to avoid running the SQL Interpreter for each update, but actually i dont believe that there is any benefit with modern CPUs, running blazingly fast, even calculating 4k videos in realtime. 30 years ago prepared statements may have been a usefull thing, but not today anymore (just my two cents). I simply would run the Query in a loop. If there is any bottleneck, its the TCPIP communication between the server and the client.

Re: Python variable to database frequent update at rate 20ti

PostPosted: 28. July 2022 10:42
by amd123coep
Thank you....
Effeccient means less consumption of resources.actually am reading value from another webpage and adding into my database.like rate of currancy...