question

Begoña Espiñeira avatar image
0 Likes"
Begoña Espiñeira asked Jason Lightfoot commented

Column Set - Statistics Collector

Hi, I have a question about the Column Set of the statistics collector.The main problem is that when I increase the range of the columns to set in the statistics, it doesn't work as it should, the values I want to record from the "Total" column of the GlobalTable1 are not the correct ones. Is there a limit of columns to add for the Column Set? I have made a small model where you can see the differences by simply changing the range of columns in the "columns" parameter.


1646151440578.png




1646151401371.png



ColumnSet.fsm

Thank you in advance!

FlexSim 22.0.1
statistics collectorcolumn setdynamic columns in statisticscollector
1646151401371.png (70.1 KiB)
1646151440578.png (54.4 KiB)
columnset.fsm (306.8 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Jason Lightfoot commented

There is a limit for the number of columns for a Statistics Collector, because that object stores its data in a Bundle node. The limit is actually based on the number of bytes per row. The maximum number of bytes per row is 65535. Each double column requires 8 bytes. So if all your columns are double types (which is the case for you), you can only have 8191 fields.

I'll add an issue to the dev list, to find a way to throw an exception if you hit the limit.

By contrast, the limit on the number of rows in a bundle is much, much higher (~2 billion). If you simply appended your entire global table (with 20000 rows), along with a column that specified the time, you could do that ~100k times before running in to trouble.

You could also do a hybrid approach, where you have 8000 columns; each time interval would add 3 rows, and the values from the first 8000 rows of your global table would go in the first row of the stats collector. The next 8000 rows of the global table would go in the second row if the stats collector. The next 4000 rows would go in the 3rd row, leaving the last 4k columns in the 3rd row blank. You could use this method to record all 20000 values more than 600k times.

But this question makes me think that there is a better approach possible than any of these suggestions. I don't understand the high-level goal of what you are trying to record, or why. But in 99% of cases with millions of rows or thousands of columns, there's a better way to record the data that you actually need. For example, it seems like most of the 20000 rows in the global table wouldn't change every second. There are ways to make it so that the stats collector only records when one of those values changes, instead of recording all values at every time step. This approach uses a lot less data to capture every value change.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Begoña Espiñeira avatar image Begoña Espiñeira commented ·

Thank you very much Jordan! I have done the record in a Global Table as you said. We usually don't have to record that range of data but in this case we have to record the stock data of a warehouse by sku every 15 minutes and the warehouse has approximately 20000 skus. The format we were asked to output is a table with one sku per column along with a column specifiying the time so thats why I wanted to do in that way. Thank you for all the information!

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Begoña Espiñeira commented ·
If you were putting this into a database you'd have 3 columns/fields for each record: SKU, Time, Qty. No dbadmin that I know would add all the SKUs as field names - querying it would also be uncomfortable.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.