Created
January 23, 2026 10:54
-
-
Save daiplusplus/e515450ae1e9f5dd0576a7c84f6b2264 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- query 1: index seek as expected | |
| SELECT COUNT_BIG(*) FOR_YOU | |
| FROM dbo.REEEEEEEEEEECOMPILE ree | |
| WHERE 1 = NULL OR (ree.COL2 > 0) | |
| OPTION (RECOMPILE, QUERYTRACEON 8605, QUERYTRACEON 8606, QUERYTRACEON 8607, QUERYTRACEON 3604) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *** Converted Tree: *** | |
| LogOp_Project COL: Expr1002 | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| ******************* | |
| *** Input Tree: *** | |
| LogOp_Project COL: Expr1002 | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| ******************* | |
| *** Simplified Tree: *** | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ******************* | |
| *** Join-collapsed Tree: *** | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ******************* | |
| *** Tree Before Project Normalization *** | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ***************************************** | |
| *** Tree After Project Normalization *** | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| **************************************** | |
| *** Output Tree: (trivial plan) *** | |
| PhyOp_StreamGbAgg( ) | |
| PhyOp_NOP | |
| PhyOp_Range TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree)(2) ASC Bmk ( COL: Bmk1000 ) IsRow: COL: IsBaseRow1001 | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ******************** | |
| ** Query marked as Cachable | |
| ******************** | |
| (1 row affected) | |
| (3 rows affected) | |
| (1 row affected) | |
| Completion time: 2026-01-23T02:52:16.7619275-08:00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- query 2: no seek available (FORCESEEK throws error 8622) | |
| SELECT COUNT_BIG(*) FOR_YOU | |
| FROM dbo.REEEEEEEEEEECOMPILE ree | |
| WHERE 1 = NULL OR (ree.COL1 = 0 AND ree.COL2 > 0) | |
| OPTION (RECOMPILE, QUERYTRACEON 8605, QUERYTRACEON 8606, QUERYTRACEON 8607, QUERYTRACEON 3604) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *** Converted Tree: *** | |
| LogOp_Project COL: Expr1002 | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Logical x_lopAnd | |
| ScaOp_Comp x_cmpEq | |
| ScaOp_Identifier QCOL: [ree].COL1 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| ******************* | |
| *** Input Tree: *** | |
| LogOp_Project COL: Expr1002 | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Logical x_lopAnd | |
| ScaOp_Comp x_cmpEq | |
| ScaOp_Identifier QCOL: [ree].COL1 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| ******************* | |
| *** Simplified Tree: *** | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Logical x_lopAnd | |
| ScaOp_Comp x_cmpEq | |
| ScaOp_Identifier QCOL: [ree].COL1 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ******************* | |
| *** Join-collapsed Tree: *** | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Logical x_lopAnd | |
| ScaOp_Comp x_cmpEq | |
| ScaOp_Identifier QCOL: [ree].COL1 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ******************* | |
| *** Tree Before Project Normalization *** | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Logical x_lopAnd | |
| ScaOp_Comp x_cmpEq | |
| ScaOp_Identifier QCOL: [ree].COL1 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ***************************************** | |
| *** Tree After Project Normalization *** | |
| LogOp_GbAgg OUT(COL: Expr1002 ,) | |
| LogOp_Select | |
| LogOp_Get TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) dbo.REEEEEEEEEEECOMPILE TableID=1618104805 TableReferenceID=0 IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Logical x_lopAnd | |
| ScaOp_Comp x_cmpEq | |
| ScaOp_Identifier QCOL: [ree].COL1 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| **************************************** | |
| *** Output Tree: *** | |
| PhyOp_StreamGbAgg<global>( ) | |
| Exchange Start | |
| PhyOp_StreamGbAgg<local>( ) | |
| PhyOp_Filter | |
| PhyOp_TableScan TBL: dbo.REEEEEEEEEEECOMPILE(alias TBL: ree) Bmk ( Bmk1000) IsRow: COL: IsBaseRow1001 | |
| ScaOp_Logical x_lopOr | |
| ScaOp_Const TI(bit,Null,ML=1) XVAR(bit,Not Owned,Value=NULL) | |
| ScaOp_Logical x_lopAnd | |
| ScaOp_Comp x_cmpEq | |
| ScaOp_Identifier QCOL: [ree].COL1 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| ScaOp_Comp x_cmpGt | |
| ScaOp_Identifier QCOL: [ree].COL2 | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: partialagg1003 | |
| ScaOp_AggFunc stopCountBig Transformed | |
| ScaOp_Const TI(int,ML=4) XVAR(int,Not Owned,Value=0) | |
| AncOp_PrjList | |
| AncOp_PrjEl COL: Expr1002 | |
| ScaOp_AggFunc stopAccumNull | |
| ScaOp_Identifier COL: partialagg1003 | |
| ******************** | |
| ** Query marked as Cachable | |
| ******************** | |
| ** Query cachability updated to FALSE | |
| ******************** | |
| (1 row affected) | |
| (5 rows affected) | |
| (1 row affected) | |
| Completion time: 2026-01-23T02:51:16.6923324-08:00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment