A SQL query that includes an IN-List is optimized by utilizing an array insert to insert the IN-List into a spool and piggybacking IN-List rows into a join step.