Easy charts - two identical SQL queries

Hi guys,

I have some Easy charts using DB pens, and the source is a bit heavy to load (Views and calculations) and takes time and a lot of CPU load. In Database status page I see that Ignition is making the same query twice. Is there any reason for this?

Thanks in advance.

It’s not the same query per-se, the ‘?’ stands for a value that will be replaced. Sadly, I don’t know a way to view the actual values.

That said it’s also possible to get the same query twice, f.e. when you have a client and a designer open with that chart, two queries will be send to the DB server, and both will be logged.

Actual solutions for the problem are a lot harder to find. Are the queries slow (if so, why? Fragmented DB, fragmented HDD, tables too big, …), or is the drawing slow?

Can you reduce the number of values that need to be fetched? Or perhaps preload them in an SQL query tag on the server or even on the client directly. This all depends on where the current bottleneck is, and how many clients you’ll have with that chart open vs how many clients in total.

1 Like

Thanks for replying.

The query is the same. I did limit the range to 3 days to make the data easier to load and “?” was replaced with actual dates. I think Easy chart will load ALL available data if not. See picture from the SQL server workbench thread list.

My Easy Chart has two pens, finalTMP and avgTPM load from the same SQL table. I can’t understand why Ign need to run the same query twice.