# Sqlth\_sce Updating Query issue

**URL:** <https://forum.inductiveautomation.com/t/sqlth-sce-updating-query-issue/15916>\
**Category:** Ignition\
**Tags:** database\
**Created:** [November 7, 2017, 11:22am UTC](https://forum.inductiveautomation.com/t/sqlth-sce-updating-query-issue/15916 "2017-11-07T11:22:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aqua](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@aqua](https://forum.inductiveautomation.com/u/aqua)\
**Post date:** [November 7, 2017, 11:22am UTC](https://forum.inductiveautomation.com/t/sqlth-sce-updating-query-issue/15916/1 "2017-11-07T11:22:35Z")

</div>

Hi,  
I have frequent stops of my MySQL. After some searches I found that It’s caused by UPDATE query/  
For example:  
UPDATE ‘sqlth\_sce’ SET ‘end\_time’=1510052581045 WHERE ‘scid’=2 and ‘rate’=10000 and ‘start\_time’\<=1510052581045 and ‘end\_time’\>=1510052561045  
The most interesting that there is one row which according to ‘where clause’ but query is hanging till server stop. Could someone tell me what is the reason?

---

<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:** [November 7, 2017, 12:08pm UTC](https://forum.inductiveautomation.com/t/sqlth-sce-updating-query-issue/15916/2 "2017-11-07T12:08:22Z")

</div>

Do you have indices on the columns in your where clause? Particularly start\_time and end\_time. If not, your server has to scan the entire table every time you ask it to do this operation. If the table is large and other stuff depends on it, all of those dependencies will stop.

---

<div class="post-metadata">

**Author:** ![aqua](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@aqua](https://forum.inductiveautomation.com/u/aqua)\
**Post date:** [November 7, 2017, 3:34pm UTC](https://forum.inductiveautomation.com/t/sqlth-sce-updating-query-issue/15916/3 "2017-11-07T15:34:02Z")

</div>

No, there are no indices. It’s table created by Ignition which keeps records of scanclasses. I don’t call this query, it’s updating by Ignition automatically.

---

<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:** [November 7, 2017, 6:39pm UTC](https://forum.inductiveautomation.com/t/sqlth-sce-updating-query-issue/15916/4 "2017-11-07T18:39:45Z")

</div>

You’ll have to get your database group to add indices at least on those columns. Ignition doesn’t always make the indices one needs.
