in reply to Help with database query
Rather than executing thousands of queries to test each ID individually, get all ids then just test for each potential ID in the results.
my $results = $dbh->selectall_arrayref("SELECT ID from table", { Slice + => {} }); my %ids = map { $_->{ID} => '1' } @$results; for ( 1 .. 10000 ) { next if $ids{$_}; #do site stuff here or push to an array to use later print "$_\n"; }
|
|---|