Your script isn't doing much, so I'd guess you have a lot of data or a slow machine to run it on.
Please provide:
In reply to Re: script optimization by thargas in thread script optimization by tannx