| Filename | /usr/share/koha/lib/Koha/QueryParser/Driver/PQF/query_plan.pm |
| Statements | Executed 10 statements in 344µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 19µs | 229µs | Koha::QueryParser::Driver::PQF::query_plan::BEGIN@2 |
| 1 | 1 | 1 | 12µs | 15µs | Koha::QueryParser::Driver::PQF::query_plan::BEGIN@4 |
| 1 | 1 | 1 | 12µs | 25µs | Koha::QueryParser::Driver::PQF::query_plan::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | Koha::QueryParser::Driver::PQF::query_plan::target_syntax |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Koha::QueryParser::Driver::PQF::query_plan; | ||||
| 2 | 3 | 38µs | 2 | 439µs | # spent 229µs (19+210) within Koha::QueryParser::Driver::PQF::query_plan::BEGIN@2 which was called:
# once (19µs+210µs) by Koha::QueryParser::Driver::PQF::BEGIN@9 at line 2 # spent 229µs making 1 call to Koha::QueryParser::Driver::PQF::query_plan::BEGIN@2
# spent 210µs making 1 call to base::import |
| 3 | |||||
| 4 | 3 | 28µs | 2 | 19µs | # spent 15µs (12+3) within Koha::QueryParser::Driver::PQF::query_plan::BEGIN@4 which was called:
# once (12µs+3µs) by Koha::QueryParser::Driver::PQF::BEGIN@9 at line 4 # spent 15µs making 1 call to Koha::QueryParser::Driver::PQF::query_plan::BEGIN@4
# spent 3µs making 1 call to strict::import |
| 5 | 3 | 274µs | 2 | 39µs | # spent 25µs (12+14) within Koha::QueryParser::Driver::PQF::query_plan::BEGIN@5 which was called:
# once (12µs+14µs) by Koha::QueryParser::Driver::PQF::BEGIN@9 at line 5 # spent 25µs making 1 call to Koha::QueryParser::Driver::PQF::query_plan::BEGIN@5
# spent 14µs making 1 call to warnings::import |
| 6 | |||||
| 7 | =head1 NAME | ||||
| 8 | |||||
| - - | |||||
| 21 | sub target_syntax { | ||||
| 22 | my ($self, $server) = @_; | ||||
| 23 | my $pqf = ''; | ||||
| 24 | my $node_pqf; | ||||
| 25 | my $node_count = 0; | ||||
| 26 | |||||
| 27 | for my $node ( @{$self->query_nodes} ) { | ||||
| 28 | |||||
| 29 | if (ref($node)) { | ||||
| 30 | $node_pqf = $node->target_syntax($server); | ||||
| 31 | $node_count++ if $node_pqf; | ||||
| 32 | $pqf .= $node_pqf; | ||||
| 33 | } | ||||
| 34 | } | ||||
| 35 | $pqf = ($self->joiner eq '|' ? ' @or ' : ' @and ') x ($node_count - 1) . $pqf; | ||||
| 36 | $node_count = ($node_count ? '1' : '0'); | ||||
| 37 | for my $node ( @{$self->filters} ) { | ||||
| 38 | if (ref($node)) { | ||||
| 39 | $node_pqf = $node->target_syntax($server); | ||||
| 40 | $node_count++ if $node_pqf; | ||||
| 41 | $pqf .= $node_pqf; | ||||
| 42 | } | ||||
| 43 | } | ||||
| 44 | $pqf = ($self->joiner eq '|' ? ' @or ' : ' @and ') x ($node_count - 1) . $pqf; | ||||
| 45 | foreach my $modifier ( @{$self->modifiers} ) { | ||||
| 46 | my $modifierpqf = $modifier->target_syntax($server, $self); | ||||
| 47 | $pqf = $modifierpqf . ' ' . $pqf if $modifierpqf; | ||||
| 48 | } | ||||
| 49 | return ($self->negate ? '@not @attr 1=_ALLRECORDS @attr 2=103 "" ' : '') . $pqf; | ||||
| 50 | } | ||||
| 51 | |||||
| 52 | 1 | 3µs | 1; |