Transaction groups delete records older than

How can this be configured? Because I can’t find any example anywhere! The database I am using is MYSQL!

Because you have tagged your question with “scripting”, does this mean you are looking to understand how to configure that option via a script?

I just want to understand how to configure this feature. Like where you need to click, so that it works. Because it writes to the database but does not delete or overwrite!

Why do you think that it is not working? I was testing this feature out recently and it did delete older records. However it does not perform a delete action all the time. The delete runs at some unspecified rate (but related to the rate that you are inserting), so that at any point in time you can have records older than 1 minute in your table.

See this question Delete records older than (Transaction Groups) - How does this work?

Stupid question. Your update mode is DB => OPC.

  • DB to OPC - Only read from the database and write to the OPC Server.

Should that be "OPC => DB" instead?

  • OPC to DB - Only read from the OPC server and write to the database.

Yes, my mode OPC to DB, but anyways, it is not deleting anything.


With the deleting set to “older than 1 minute” I have seen my tables grow to contain 2 minutes worth of data before the deleting occurs. And then it deletes back down to 1 minutes worth of data. The screen you show only has 1 minute and 40 seconds worth of data in it

Are you sure your DB connection has delete privileges? Can you run DELETE from the query browser?

How i can check it?

Try running DELETE FROM statustest WHERE t_stamp <= .... in the query browser.

Like that?

it is WORK!
How this script work everytime?

Do you mean that you manually deleted the records? But the automatic deletion is still not working?

Yes

From another thread, the deletion is a separate task from the group:

That said, is there anything in the log?

1 Like

I have that.


I don`t see that anything deleting rows in DB.

It is not working for me. Can you help me with it?

This sound like something for IA support to help with, as I cannot replicate it. Pinging @PGriffith.

As a workaround, you have a couple of options.

  • A gateway timer script that deletes the older rows.
  • A second transaction group that deletes the rows directly without using the ‘Delete records’ feature.

As an aside, also let us know what specific version of Ignition you are using.

Ignition 8.0.16.
I create some code, which delete these rows but i don`t know where i should write code.
code in MySQL, but i think that must do Ignition.
SELECT * FROM test.statustest;
delete from test.statustest where t_stamp<=DATE_SUB(NOW(), INTERVAL 11 DAY);
SELECT * FROM test.statustest;