# Is there a way to reduce delay between database reading/writing?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137>\
**Category:** Ignition\
**Tags:** database\
**Created:** [February 26, 2018, 2:53pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137 "2018-02-26T14:53:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![carolineuchoa.estuda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carolineuchoa.estuda](https://forum.inductiveautomation.com/u/carolineuchoa.estuda)\
**Post date:** [February 26, 2018, 2:53pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137/1 "2018-02-26T14:53:15Z")

</div>

So I have a system that sends information to Ignition via OPC-UA. I connected a MSSQL database to it, so that I could use realtime charts and stuff. But my problem is that the chart data writing is too delayed from the real life changes, about 10 seconds apart.  
Example: If I change some rotation in my system, I’d like to see that change in the charts of Ignition almost instantaneously, but unfortunately, that change just shows in the chart about 10 seconds later. Is there a way to reduce that delay? Thanks.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 26, 2018, 3:05pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137/2 "2018-02-26T15:05:10Z")

</div>

You’ll have to provide more information:

1. Are all of the clocks on these computers synchronized? Including the client and the database?
2. What scan class settings are you using for any tags being recorded? What deadband and maximum recording interval?
3. What timing and trigger settings are you using in transaction groups (if applicable)?
4. When you manually run an INSERT statement to that database from the designer’s Query Browser, what execution time do you see?
5. When you manual run a SELECT statement of the charted data what execution time do you see?

---

<div class="post-metadata">

**Author:** ![Kevin.Collins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.collins/32/13497_2.png) [@Kevin.Collins](https://forum.inductiveautomation.com/u/Kevin.Collins)\
**Post date:** [February 26, 2018, 7:15pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137/3 "2018-02-26T19:15:30Z")

</div>

Keep in mind that the `Default Historical` scan-class is set to 10s by default… Changing that might improve things a bit… Definitely agree with @pturmel’s request for additional information in order to narrow the scope down.

---

<div class="post-metadata">

**Author:** ![carolineuchoa.estuda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carolineuchoa.estuda](https://forum.inductiveautomation.com/u/carolineuchoa.estuda)\
**Post date:** [February 27, 2018, 2:02pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137/4 "2018-02-27T14:02:54Z")

</div>

@Kevin.Collins @pturmel Thanks for the reply.  
I changed some configurations and the delay is now reduced to about 3sec, but I want to improve it even more. Is there anything I can change in order to get the delay closer to 0sec or 1sec now? Answering questions 1, 2 and 3: I’m using ignition and the database in the server computer, so there is no way the clock is unsynchronized and that’s my config now:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/42d1d1c9936ca8384f89e9a75610dedc1e57a3dd.png)

I don’t know now how to answer questions 4 and 5, but I’ll try to as soon as possible. Thanks!

---

<div class="post-metadata">

**Author:** ![carolineuchoa.estuda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carolineuchoa.estuda](https://forum.inductiveautomation.com/u/carolineuchoa.estuda)\
**Post date:** [February 27, 2018, 2:03pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137/5 "2018-02-27T14:03:29Z")

</div>

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7e776e7f19617c4a9024594e95fd4d784bf3d38d.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 27, 2018, 2:12pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137/6 "2018-02-27T14:12:34Z")

</div>

The default scan class reads the PLC at 1-second intervals (unless you’ve changed it). It is simply impossible in the real world to have zero delay, but fractional second delays are possible if your devote enough processing power to it (by using a faster scan class or speeding up the default).  
Also, you chosen a history storage setup that won’t record unless the value changes (by 0.01), so steady values will show no new data to plot. Consider setting the max time between records to suit your needs, and setting up a historical scanclass that will evaluate often enough to ensure recording at that pace.

---

<div class="post-metadata">

**Author:** ![carolineuchoa.estuda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carolineuchoa.estuda](https://forum.inductiveautomation.com/u/carolineuchoa.estuda)\
**Post date:** [February 27, 2018, 2:28pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137/7 "2018-02-27T14:28:37Z")

</div>

> [@pturmel](#):
>
> by using a faster scan class or speeding up the default)

but is there a way I can speed up the default? and how do I choose a faster scan class? Sorry if these are dumb questions, but I'm new to Ignition.  
Do you recommend any configurations in the tag editor that I can use to reduce the delay? Like what value would you choose to the max records config? And is the "evaluate on change" historical scanclass the right scanclass for what I'm looking for? Thanks a lot.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 27, 2018, 5:13pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-reduce-delay-between-database-reading-writing/17137/8 "2018-02-27T17:13:35Z")

</div>

Take a look at [this section](https://www.inductiveuniversity.com/video/setting-a-tags-scan-class) of the [Inductive University](https://www.inductiveuniversity.com/library/). Please consider going through the entire course. It’ll save you a lot of trouble learning Ignition. And it is free.
