in reply to Script won't retrieve data from database
This will reduce the number of separate calls to the database. Second, I simply do not know why in the world you would reduce the performance of your solution to reading a text file when you already have a database connection open. Just create another table with your indexes and join the two, like:use DBI; my $pathname = qq|webdb.db.db3|; my $cnstr = qq|DBI:SQLite:dbname=$pathname|; my $filename = q|afile.txt|; open(H, qq|afile.txt|) or die $!; my @lines = <H>; close(H); my $IN = '('; $IN .= join ',', map { qq|\'$_\'|} grep {chomp} @lines; $IN = 'select webpage from webpages_data WHERE id in ' . $IN . ')'; print $IN; #produces : select webpage from webpages_data WHERE id in ('koko.htm', +'koko1.htm','koko2.htm','koko3.htm')
Or a sub-select cannot have much worse performance:select webpage from webpages_data, mySelectedStuff WHERE webpage.id = +mySelectedStuff.id AND ...
select webpage from webpages_data where webpage in (select id from myS +electedStuff WHERE ...)
Celebrate Intellectual Diversity
|
|---|