Commit 6b2bb3f6 authored by Graham McVicker's avatar Graham McVicker
Browse files

use a straight_join when joining to repeat_consensus on repeat_type, because...

use a straight_join when joining to repeat_consensus on repeat_type, because the mysql query optimiser gets it wrong
parent d03eb193
......@@ -76,11 +76,20 @@ sub fetch_all_by_Slice {
my $constraint = '';
# MySQL was optimising the query the incorrect way when joining to
# the repeat_consensus table on type
$self->_straight_join(1);
if($repeat_type) {
$constraint .= "rc.repeat_type =\"$repeat_type\"";
}
return $self->fetch_all_by_Slice_constraint($slice,$constraint,$logic_name);
my $result =
$self->fetch_all_by_Slice_constraint($slice,$constraint,$logic_name);
$self->_straight_join(0);
return $result;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment