Try putting an index on the date field in the table the alarms are logging to. Some of the Ignition calls perform a lot better if you add an index to the date and include the other fields on the index.
It might vary by SQL version. I typically use MSSQL Server and I just create an index on the date field in SQL Management studio and tell it to include the other fields in the index. It makes for a significant performance improvement.
Basically all of them. The idea is that you’re creating an index in the database that allows it to quickly retrieve data for records that have a date within a range. So you’re telling the database to have an index that tracks those fields in relation to the date field. It makes the database bigger but allows it to retrieve data faster when you’re filtering by date which you are when you’re querying that data.
I’m not certain that the way I’ve been doing it is the best way but it is really clear that it makes the historic query methods in Ignition perform a lot faster.
I wasn’t trying to say to index all fields. I was saying to index the date field and link the other fields to that index.
I almost exclusively work in MSSQL. What I do is I add a non-clustered index to the date field on the table. Then I add the other fields that would be returned on queries against that filter to the “included columns” tab. My understanding is that makes it faster for the db to return the columns when the query because of internal stuff that happens on the database.
That is a good clarification to make sorry for any confusion.
PS. @pturmel knows what he’s talking about with this. It was one of his posts that gave me the idea to index the table and it worked for me. Feel free to correct me on anything or explain it better