Dear Laura,
Thank you for letting me know! I made some changes and the function worked initially. However, after I saved the changes, closed and opened the workspace again, it showed me again that the execution speed was not high enough.
I have performed the following changes in the main file:
system"l ",getenv[`AX_WORKSPACE],"/AdvancedCapstone.Setup/dbmaint.q"
setattrcol[`:.;`sensor;`lapId;`g]
setattrcol[`:.;`sensor;`sensorId;`p]
I have changed the code in the .viz.getModSensor as well:
select from sensor where date in 2020.01.01 2020.01.02, sensorId in symbols, 0=lapId mod 2