Lots of debugging. Revised the SQL for getting PII; it's a bit faster, but still somewhat slow.