AtteanX/QueryPlanner/Cache/LDF.pm

filter: Statementstmt 42.2% 19 / 45 Branchbran 0.0% 0 / 20 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 32.0% 24 / 75 CC 14 SCAR 50.4
CC
14
Cov
28%
allow_join_rotation
210.0
BEGIN
1.0
BEGIN
1.0
CRAP 155.0
« AtteanX/Model/SPARQLCache/LDF.pm ↑ Summary AtteanX/Query/Cache/Retriever.pm »
1 9 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5  
6 package AtteanX::QueryPlanner::Cache::LDF;
7  
8 9 our $AUTHORITY = 'cpan:KJETILK';
9 9 our $VERSION = '0.002';
10  
11 9 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 9 ▶use AtteanX::Query::AccessPlan::PrefetchLDF;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 9 extends 'AtteanX::QueryPlanner::Cache';
15 9 with 'AtteanX::Query::AccessPlan::PrefetchLDF';
16  
17 # Only allow rotation on joins who have one child matching: - Either a
18 # Attean::Plan::Quad, AtteanX::Plan::SPARQLBGP, or
19 # AtteanX::Plan::LDF::Triple and the other child being a join
20  
21 0 ▶sub allow_join_rotation {
Subroutine allow_join_rotation: not called CC=14 SCAR=53.5
Pod undocumented
22 0 my $self = shift;
23 0 my $join = shift;
24 0 ▶ my $quads = shift // 0;
Condition0%0/2
shift() // 0
l!l
00
MC/DC0%0/1
shift() // 0
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
25 0 my $joins = 0;
26 0 my @grandchildren;
27 0 $self->log->trace("Seeking to rotate:\n" . $join->as_string);
28 0 foreach my $p (@{ $join->children }) {
29 0 ▶ $quads++ if ($p->isa('Attean::Plan::Quad'));
Branch: 1 branch
BranchTrueFalseTotal
if $p->isa("Attean::Plan::Quad") 0 0 0
30 0 ▶ $quads++ if ($p->isa('AtteanX::Plan::LDF::Triple'));
Branch: 1 branch
BranchTrueFalseTotal
if $p->isa("AtteanX::Plan::LDF::Triple") 0 0 0
31 0 ▶ $quads++ if ($p->isa('AtteanX::Plan::SPARQLBGP'));
Branch: 1 branch
BranchTrueFalseTotal
if $p->isa("AtteanX::Plan::SPARQLBGP") 0 0 0
32 0 ▶ if ($p->does('Attean::API::Plan::Join')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($p->does("Attean::API::Plan::Join")) 0 0 0
33 0 $joins++;
34 0 push(@grandchildren, @{ $p->children });
35 }
36 }
37 0 ▶ return 0 unless ($joins == 1);
Branch: 1 branch
BranchTrueFalseTotal
unless $joins == 1 0 0 0
38 0 ▶ return 0 unless ($quads == 1);
Branch: 1 branch
BranchTrueFalseTotal
unless $quads == 1 0 0 0
39 0 foreach my $p (@grandchildren) {
40 0 ▶ $quads++ if ($p->isa('Attean::Plan::Quad'));
Branch: 1 branch
BranchTrueFalseTotal
if $p->isa("Attean::Plan::Quad") 0 0 0
41 0 ▶ $quads++ if ($p->isa('AtteanX::Plan::LDF::Triple'));
Branch: 1 branch
BranchTrueFalseTotal
if $p->isa("AtteanX::Plan::LDF::Triple") 0 0 0
42 0 ▶ $quads++ if ($p->isa('AtteanX::Plan::SPARQLBGP'));
Branch: 1 branch
BranchTrueFalseTotal
if $p->isa("AtteanX::Plan::SPARQLBGP") 0 0 0
43 }
44
45 0 ▶ if ($quads >= 2) {
Branch: 1 branch
BranchTrueFalseTotal
if ($quads >= 2) { } 0 0 0
46 0 $self->log->debug("Allowing rotation for $quads quads.");
47 0 return 1;
48 } else {
49 0 $self->log->debug("Disallowing rotation, just $quads quad.");
50 0 return 0;
51 }
52 }
53  
54  
55 9 1;
« AtteanX/Model/SPARQLCache/LDF.pm ↑ Summary AtteanX/Query/Cache/Retriever.pm »