Rule of thumb for dataset tag row count pruning?

EDIT: This is Ignition EDGE. So no databases can be involved. Otherwise I’d just write to that and be done with it.

I’m doing some stuff with scripting and a dataset tag. I do have pruning in my scripting, but it’s based on a timestamp (everything older than X days ago gets deleted). But if I have a particularly “busy” site where lots of events happen, I’m concerned about having datasets that are so big they affect performance, considering datasets are immutable and when they’re modified they have to be pulled in in their entirety and then recreated with the new data before they’re written back out. Not necessarily a huge deal when there’s a couple hundred rows. But I’m sure at some point (thousands of rows? tens of thousands? millions?) that things could potentially become an issue.

I’m pretty sure I’m going to have to impose some kind of limit on the number of records in these dataset tags, but I don’t really know what that should be, or even where to start. Initially I’m thinking something like, 10,000 rows. Whenever the dataset hits that, the oldest records get pruned off regardless of age. Is that a reasonable limit? Can I go more? Should I not go so high?

Update: I’m running some simulation logic in the PLC project I have that pushes events very frequently. I’m up to almost 1000 rows in the dataset. So far, no increase in my script execution time (ranges from almost 0ms to around 250ms).

What exactly are you storing in these tags and what is consuming/using them? Are they used for dashboard displays? Alarm history? Trending?

I've got a dataset tag that I limit to 10,000 rows. Hasn't effected performance so far. There is a point where it DOES start to slow things down, but it was quite a bit higher - I just decided 10,000 was more than I should EVER need for this particular use.

Event history data from the PLC. There’s a trigger tag in the PLC I have a Gateway tag change script pointing at, that launches a “get events” script that reads in the dataset for the latest timestamp, goes to the PLC array, does direct OPC reads one by one until it hits old or empty data, and then pulls whatever it found into the dataset. I’m only hitting the PLC for a few tags at a time (I don’t control the PLC program and they have a huge array in it they’re using as a log), but the downside of that is my dataset gets bigger and bigger over time. Like I said, I did put pruning on it by date, but I don’t feel good about not having row count pruning as well.

I would move away from tags for this, and use a table in the database. Thats what they're for, then your concerns disappear.

Can’t. This is Ignition Edge.