Some more about your query. I just noticed that your table name is "AllJoinRecip", leading me to assume this table is a view (or result of some other query) joining one or more tables/views. Things you can do to improve run/build time:
- If you can, make sure your query to build "AllJoinRecip" includes only columns you actually need in the result set
- Be careful to avoid a "Cartesian Product". This is a query that returns every possible combination of every row from every table in the query. You can identify this if your result set contains more rows than all of the tables/views in your "From" clause combined.
- In my earlier response, I suggested using "SELECT DISTINCT" in your query, but I was speaking about the only query to which you provided visibility. Maybe you can use the "SELECT DISTINCT" to build "AllJoinRecip" to keep your source data set as small as possible coming into the Perl script.
I hope this helps.