[quote=“KathyApplebaum”]My guess is the query itself is slow and that reporting isn’t the culprit. You can check this pretty easily in the query playground.
There’s two things I generally look at for slow queries; the hardware for the database and the setup of the database. In this case, I’m going to go out on a limb and suggest you look at the hardware first.
Is your database on the same machine as your Gateway? If so, consider moving it. Databases like lots of lots of RAM for themselves and they like really fast disk access. I recently had a situation where the exact same database took 30 times longer to query on a machine with less RAM and a slightly slower disk. (It was literally the same database, moved to the second machine with a sql dump). Less RAM meant a lot more disk access, especially for the indexes, which slowed things way down.
If you’re satisfied with the hardware set up (or not able to change it), the next step is to examine the query itself. Fill in some sample values for your t_stamp and tagids in the query, and in the command line or a tool like MySQL workbench, use the EXPLAIN command to see how the query is actually being done. Given the default indexes on this table, you may not find anything you can improve here, but it’s worth looking at.[/quote]
yes the database are in the same machine with ignition, my client only provide one PC for this application. i will try to increase the RAM. but when i use power table to query the same data from the database, everything looks good…
i will update this as soon as i upgrade the RAM. im going to put 8GB RAM.