It's not a sed limit, but a bash command line lenght limit: it is getconf ARG_MAX
bytes max (on Linux I have seen values for this value from 131072 to 2621440).
The comment from René Nyffenegger is wise: Perl is the better option for this class of problems, in the *NIX world...
If you describe how you need to select the rows to be extracted (i.e.: from i to j? or a list of specific rows?, some different logic?), it should be easy to give you a code sample...
UPDATE:
Below I give you an example for the first use case. Of course, if you give an example of some use case, if a pattern can be found, it should be easy to simplify the solution for the second - more generic - use case...
#!/usr/bin/perl
#
# Print a range of lines from a text file.
# Usage: extract-a-range-of-lines.pl first-line last-line input-file
# use ARGV to verify the number of perl command line arguments
@ARGV == 3 or die "Usage: $0 first-line last-line input-file\n";
my ($first_line, $last_line, $filename) = @ARGV;
open(my $FILE, "<", $filename) or die "Could not read from $filename ($!)"; # open the input file
# loop through the input file
my $count = 1;
while (<$FILE>) {
last if ($count > $last_line); # break loop when you get to the last line
print $_ if ($count >= $first_line); # print the current line if the line number is greater than first param
$count++; # increment the line counter
}
close $FILE; # close input file