@@ -460,8 +460,11 @@ class JoinMode(enum.Enum):
460
460
# second column of each input table as a new column
461
461
CHANGE = 1
462
462
# Join using the first column as a key, indicating the change in the second
463
- # column of each input table as a ne column, and omit all other columns
463
+ # column of each input table as a new column, and omit all other columns
464
464
CHANGE_ONE_COLUMN = 2
465
+ # Join using the first column as a key, and indicate the change as a new
466
+ # column, but don't sort by the amount of change.
467
+ CHANGE_NO_SORT = 3
465
468
466
469
467
470
class Table :
@@ -484,7 +487,7 @@ def join_row(self, key: str, row_a: tuple, row_b: tuple) -> tuple:
484
487
match self .join_mode :
485
488
case JoinMode .SIMPLE :
486
489
return (key , * row_a , * row_b )
487
- case JoinMode .CHANGE :
490
+ case JoinMode .CHANGE | JoinMode . CHANGE_NO_SORT :
488
491
return (key , * row_a , * row_b , DiffRatio (row_a [0 ], row_b [0 ]))
489
492
case JoinMode .CHANGE_ONE_COLUMN :
490
493
return (key , row_a [0 ], row_b [0 ], DiffRatio (row_a [0 ], row_b [0 ]))
@@ -497,7 +500,7 @@ def join_columns(self, columns: Columns) -> Columns:
497
500
* ("Base " + x for x in columns [1 :]),
498
501
* ("Head " + x for x in columns [1 :]),
499
502
)
500
- case JoinMode .CHANGE :
503
+ case JoinMode .CHANGE | JoinMode . CHANGE_NO_SORT :
501
504
return (
502
505
columns [0 ],
503
506
* ("Base " + x for x in columns [1 :]),
@@ -1027,7 +1030,7 @@ def iter_optimization_tables(base_stats: Stats, head_stats: Stats | None = None)
1027
1030
Table (
1028
1031
("Range" , "Count:" , "Ratio:" ),
1029
1032
calc_histogram_table (name , den ),
1030
- JoinMode .CHANGE ,
1033
+ JoinMode .CHANGE_NO_SORT ,
1031
1034
)
1032
1035
],
1033
1036
)
0 commit comments