you'll probably hit like 99% performance of the unsafe cursor way with about 10% of the code
j
you'll probably hit like 99% performance of the unsafe cursor way with about 10% of the code