ym_chaitu has asked for the wisdom of the Perl Monks concerning the following question:
Hai
i have a huge table containing around 34748806 rows out of which there are duplicates as well so i need to get each and every value and check whether the value is existing in other table. But when i run the fetchrow_array value it takes too much of time(more than 18 hrs). So can any one suggest me with more fast method on how to do it.
here is the snippet of the query which i have run
i have tried to use the distinct also in mysql query but still it was of no use. the program was running but no result was displaying even after long time. Any help would be grately appreciated. Thank you Regards Chaitanya$data{RBS_query} = qq~select UserName from table where UserName <> '' +and UserName not like 'deleted%' order by UserName~; #print "Query--> ".$data{RBS_query}."\n"; $data{cur} = $data{dbh}->prepare($data{RBS_query}); $data{cur}->execute or die($data{dbh}->errstr); $data{num} = $data{cur}->rows; print "RBS Rows--> ".$data{num}."\n"; while(my @rows = $data{cur}->fetchrow_array()){ #print "Username --> ".$rows[0]."\n"; if(grep {$_ eq $rows[0]} @RBS_User_Names){ # print "Value exist in array\n"; }else{ push(@RBS_User_Names,$rows[0]); #print "value doesnot exist in array\n"; } }
Replies are listed 'Best First'. | |
---|---|
Re: Fetch Mysql huge database
by BrowserUk (Patriarch) on Sep 29, 2011 at 06:38 UTC | |
by ym_chaitu (Initiate) on Sep 29, 2011 at 11:05 UTC | |
by BrowserUk (Patriarch) on Sep 29, 2011 at 11:19 UTC | |
by ym_chaitu (Initiate) on Sep 30, 2011 at 05:31 UTC | |
by BrowserUk (Patriarch) on Sep 30, 2011 at 07:59 UTC | |
Re: Fetch Mysql huge database
by fisher (Priest) on Sep 29, 2011 at 06:22 UTC | |
Re: Fetch Mysql huge database
by Neighbour (Friar) on Sep 29, 2011 at 06:35 UTC | |
Re: Fetch Mysql huge database
by Anonymous Monk on Sep 29, 2011 at 11:49 UTC | |
Re: Fetch Mysql huge database
by rdfield (Priest) on Sep 29, 2011 at 15:02 UTC | |
by sundialsvc4 (Abbot) on Sep 29, 2011 at 17:32 UTC | |
by aaron_baugher (Curate) on Sep 29, 2011 at 20:37 UTC | |
Re: Fetch Mysql huge database
by duyet (Friar) on Sep 29, 2011 at 06:42 UTC |
Back to
Seekers of Perl Wisdom