queryTagHistory Slow Data Transfer

Hi,

I need to query a large amount of historical data. I’m using the queryTagHistory function in order to get the data in the proper format.

Historical_dataset = system.tag.queryTagHistory(paths, startDate, endDate)

This is the query that Ignition sends to MySQL:

SELECT `tagid`,`intvalue`,`floatvalue`,`stringvalue`,`datevalue`,`t_stamp`,`dataintegrity` FROM sqlt_data_1_2015_07 WHERE `t_stamp`>=1435730400000 and `t_stamp`<=1436594399999 and (`tagid`=64 OR `tagid`=65 OR `tagid`=66 OR `tagid`=67 OR `tagid`=68 OR `tagid`=69 OR `tagid`=72 OR `tagid`=73 OR `tagid`=74 OR `tagid`=75 OR `tagid`=76 OR `tagid`=77 OR `tagid`=78 OR `tagid`=79 OR `tagid`=80 OR `tagid`=81 OR `tagid`=82 OR `tagid`=83 OR `tagid`=84 OR `tagid`=85 OR `tagid`=86 OR `tagid`=44 OR `tagid`=45 OR `tagid`=46 OR `tagid`=47 OR `tagid`=48 OR `tagid`=49 OR `tagid`=50 OR `tagid`=51 OR `tagid`=52 OR `tagid`=53 OR `tagid`=54 OR `tagid`=55 OR `tagid`=56 OR `tagid`=57 OR `tagid`=60 OR `tagid`=61 OR `tagid`=62 OR `tagid`=63) ORDER BY `t_stamp` ASC

The query returns 26MB of data (about 550,000 lines of data). When I run the Ignition script, MySQL shows that the query runs and sends in about a second. However, the Database Connections Status page on the Ignition Gateway shows the query is active for about 45 seconds. During that time, my client freezes up. After Ignition shows the database connection closed, the rest of my script runs normally.

Has anyone else experienced this? Is this normal when querying a large amount of data using queryTagHistory? Is there anything I can do to speed it up? Any advice/ideas would be appreciated.

I’m running Ignition version 7.7.4 on Windows Server 2008. I have a MySQL database installed on the same virtual machine.

Thanks!

Check out this thread for some ideas.