Hi
I have Table that has ~88000 rows and 2 columns (both numeric). I have to sort the table by a column 1 (on model reset). The sort takes about one minute to make. Is there a way to make it any faster?
Used command: myTable.sort(1);
Hi
I have Table that has ~88000 rows and 2 columns (both numeric). I have to sort the table by a column 1 (on model reset). The sort takes about one minute to make. Is there a way to make it any faster?
Used command: myTable.sort(1);
Have you tried to use Table.addIndex and Table.getRowByKey instead of sorting your table? It requires that it is a bundle table.
Hi @tomi.kosunen, was martin.j's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.
If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.
Hi Tomi,
As Lars said, addIndex() is perfect for that task, but remember that it only works on Bundle Data tables. An alternative is to use a query with a ORDER BY Column1 ASC/DESC, Column2 ASC/DESC. This is also pretty fast even on non indexed / non bundle tables.
I did a small test with a table with 88000 rows and two columns.
You need to use square brackets [] when you have names with spaces. "SELECT * FROM OrderTable ORDER BY [Sort Order] ASC"
https://docs.flexsim.com/en/21.0/Reference/DeveloperAdvancedUser/SQLQueries
Perfect. What would be the sql syntax, if the Column header has space in its name, like
"Sort Order"?
This doesn't work: string queryStrings = "SELECT * FROM OrdetTable ORDER BY 'Sort Order' ASC";
14 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved