Is it really the reading file taking so much time or using $piece on the line and setting it to global too?

There are various things here that may slow you, even $increment (best to be replaced by i+1)

You can also split the reading file and set it to global by two parts, and use $sortbegin 

Try to run your code with %SYS.MONLBL started, it will help you understand where it spends more time.

You may slow a bit your process, to leave some process time to other processes.

to do so, you would need to use hang command, somewhere in the loop, with some small value such as 0.1 seconds, and depends how fast is your process may do it once per 100 iterations or more

Your issue with screen formatting is very interesting, it deserves a separate topic. I have not seen any issues yet with it. While I’d like to find a way to improve a standard IRIS terminal, like irissqlcli, I’d like to see the most challenging parts like this.

webTerminal obviously not a right tool for it. As a replacement for it, you can try to use ttyd, I use it for irissqlcli-web

Go to Security, Web Applications, select /csp/user, which is default app for the USER namespace, or if you need it for another namespace, find default web application for that namespace. And check Analytics there, and save

You can use whatever you want, just remember about some caveats, like issue with bitslice/bitmap indexes, which requires numerical ID

I would recommend using just a Unique Index for the UUID field and use it, it should cover most of the needs.

I've done a similar task, with much bigger databases. And it was quite good. Mirroring working with data itself, not the on the block level. So, there should not be an issue, if you do not change data stored there.