@@ -16,7 +16,7 @@ import KindPredicatesLog
1616float getBadness ( ComputeSimple simple ) {
1717 exists ( float maxTupleCount , float resultSize , float largestDependency , float denom |
1818 resultSize = simple .getResultSize ( ) and
19- extractInformation ( simple , maxTupleCount , _, _, _, _ ) and
19+ extractInformation ( simple , maxTupleCount , _, _, _) and
2020 largestDependency = max ( simple .getDependencies ( ) .getADependency ( ) .getResultSize ( ) ) and
2121 denom = resultSize .maximum ( largestDependency ) and
2222 denom > 0 and // avoid division by zero (which would create a NaN result).
@@ -28,24 +28,25 @@ pragma[nomagic]
2828predicate hasPipelineRun ( ComputeSimple simple , PipeLineRun run ) { run = simple .getPipelineRun ( ) }
2929
3030predicate extractInformation (
31- ComputeSimple simple , float maxTupleCount , int pipelineIndex , Array tuples ,
32- Array duplicationPercentages , Array ra
31+ ComputeSimple simple , float maxTupleCount , Array tuples , Array duplicationPercentages , Array ra
3332) {
3433 exists ( PipeLineRun run |
3534 hasPipelineRun ( simple , run ) and
3635 maxTupleCount = max ( run .getCount ( _) ) and
37- pragma [ only_bind_out ] ( tuples .getFloat ( pipelineIndex ) ) = maxTupleCount and
3836 tuples = run .getCounts ( ) and
3937 duplicationPercentages = run .getDuplicationPercentage ( ) and
4038 ra = simple .getRA ( )
4139 )
4240}
4341
4442from
45- ComputeSimple evt , float f , float maxTupleCount , int pipelineIndex , Array tuples ,
46- Array duplicationPercentages , Array ra
43+ ComputeSimple evt , float badness , float maxTupleCount , Array tuples , Array duplicationPercentages ,
44+ Array ra , int index
4745where
48- f = getBadness ( evt ) and
49- f > 1.5 and
50- extractInformation ( evt , maxTupleCount , pipelineIndex , tuples , duplicationPercentages , ra )
51- select evt , f , pipelineIndex , tuples , duplicationPercentages , ra order by f desc
46+ badness = getBadness ( evt ) and
47+ badness > 1.5 and
48+ extractInformation ( evt , maxTupleCount , tuples , duplicationPercentages , ra )
49+ select evt .getPredicateName ( ) as predicate_name , badness , index ,
50+ tuples .getFloat ( index ) as tuple_count ,
51+ duplicationPercentages .getFloat ( index ) as duplication_percentage , ra .getString ( index ) order by
52+ badness desc
0 commit comments