github.com/whtcorpsinc/milevadb-prod@v0.0.0-20211104133533-f57f4be3b597/dbs/cmd/benchdb/explaintest/r/window_function.result (about) 1 use test; 2 drop causet if exists t; 3 create causet t (a int, b int, c timestamp, index idx(a)); 4 set @@milevadb_enable_window_function = 1; 5 set @@stochastik.milevadb_window_concurrency = 1; 6 explain select sum(a) over() from t; 7 id estRows task access object operator info 8 Projection_7 10000.00 root DeferredCauset#6 9 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over() 10 └─IndexReader_12 10000.00 root index:IndexFullScan_11 11 └─IndexFullScan_11 10000.00 cop[einsteindb] causet:t, index:idx(a) keep order:false, stats:pseudo 12 explain select sum(a) over(partition by a) from t; 13 id estRows task access object operator info 14 Projection_7 10000.00 root DeferredCauset#6 15 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a) 16 └─IndexReader_10 10000.00 root index:IndexFullScan_9 17 └─IndexFullScan_9 10000.00 cop[einsteindb] causet:t, index:idx(a) keep order:true, stats:pseudo 18 explain select sum(a) over(partition by a order by b) from t; 19 id estRows task access object operator info 20 Projection_7 10000.00 root DeferredCauset#6 21 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.b range between unbounded preceding and current event) 22 └─Sort_11 10000.00 root test.t.a, test.t.b 23 └─TableReader_10 10000.00 root data:TableFullScan_9 24 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 25 explain select sum(a) over(partition by a order by b rows unbounded preceding) from t; 26 id estRows task access object operator info 27 Projection_7 10000.00 root DeferredCauset#6 28 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.b rows between unbounded preceding and current event) 29 └─Sort_11 10000.00 root test.t.a, test.t.b 30 └─TableReader_10 10000.00 root data:TableFullScan_9 31 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 32 explain select sum(a) over(partition by a order by b rows between 1 preceding and 1 following) from t; 33 id estRows task access object operator info 34 Projection_7 10000.00 root DeferredCauset#6 35 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.b rows between 1 preceding and 1 following) 36 └─Sort_11 10000.00 root test.t.a, test.t.b 37 └─TableReader_10 10000.00 root data:TableFullScan_9 38 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 39 explain select sum(a) over(partition by a order by b range between 1 preceding and 1 following) from t; 40 id estRows task access object operator info 41 Projection_7 10000.00 root DeferredCauset#6 42 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.b range between 1 preceding and 1 following) 43 └─Sort_11 10000.00 root test.t.a, test.t.b 44 └─TableReader_10 10000.00 root data:TableFullScan_9 45 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 46 explain select sum(a) over(partition by a order by c range between interval '2:30' minute_second preceding and interval '2:30' minute_second following) from t; 47 id estRows task access object operator info 48 Projection_7 10000.00 root DeferredCauset#6 49 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.c range between interval "2:30" "MINUTE_SECOND" preceding and interval "2:30" "MINUTE_SECOND" following) 50 └─Sort_11 10000.00 root test.t.a, test.t.c 51 └─TableReader_10 10000.00 root data:TableFullScan_9 52 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 53 set @@stochastik.milevadb_window_concurrency = 4; 54 explain select sum(a) over() from t; 55 id estRows task access object operator info 56 Projection_7 10000.00 root DeferredCauset#6 57 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over() 58 └─IndexReader_12 10000.00 root index:IndexFullScan_11 59 └─IndexFullScan_11 10000.00 cop[einsteindb] causet:t, index:idx(a) keep order:false, stats:pseudo 60 explain select sum(a) over(partition by a) from t; 61 id estRows task access object operator info 62 Projection_7 10000.00 root DeferredCauset#6 63 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a) 64 └─IndexReader_10 10000.00 root index:IndexFullScan_9 65 └─IndexFullScan_9 10000.00 cop[einsteindb] causet:t, index:idx(a) keep order:true, stats:pseudo 66 explain select sum(a) over(partition by a order by b) from t; 67 id estRows task access object operator info 68 Projection_7 10000.00 root DeferredCauset#6 69 └─Shuffle_12 10000.00 root execution info: concurrency:4, data source:TableReader_10 70 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.b range between unbounded preceding and current event) 71 └─Sort_11 10000.00 root test.t.a, test.t.b 72 └─TableReader_10 10000.00 root data:TableFullScan_9 73 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 74 explain select sum(a) over(partition by a order by b rows unbounded preceding) from t; 75 id estRows task access object operator info 76 Projection_7 10000.00 root DeferredCauset#6 77 └─Shuffle_12 10000.00 root execution info: concurrency:4, data source:TableReader_10 78 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.b rows between unbounded preceding and current event) 79 └─Sort_11 10000.00 root test.t.a, test.t.b 80 └─TableReader_10 10000.00 root data:TableFullScan_9 81 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 82 explain select sum(a) over(partition by a order by b rows between 1 preceding and 1 following) from t; 83 id estRows task access object operator info 84 Projection_7 10000.00 root DeferredCauset#6 85 └─Shuffle_12 10000.00 root execution info: concurrency:4, data source:TableReader_10 86 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.b rows between 1 preceding and 1 following) 87 └─Sort_11 10000.00 root test.t.a, test.t.b 88 └─TableReader_10 10000.00 root data:TableFullScan_9 89 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 90 explain select sum(a) over(partition by a order by b range between 1 preceding and 1 following) from t; 91 id estRows task access object operator info 92 Projection_7 10000.00 root DeferredCauset#6 93 └─Shuffle_12 10000.00 root execution info: concurrency:4, data source:TableReader_10 94 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.b range between 1 preceding and 1 following) 95 └─Sort_11 10000.00 root test.t.a, test.t.b 96 └─TableReader_10 10000.00 root data:TableFullScan_9 97 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 98 explain select sum(a) over(partition by a order by c range between interval '2:30' minute_second preceding and interval '2:30' minute_second following) from t; 99 id estRows task access object operator info 100 Projection_7 10000.00 root DeferredCauset#6 101 └─Shuffle_12 10000.00 root execution info: concurrency:4, data source:TableReader_10 102 └─Window_8 10000.00 root sum(cast(test.t.a, decimal(65,0) BINARY))->DeferredCauset#6 over(partition by test.t.a order by test.t.c range between interval "2:30" "MINUTE_SECOND" preceding and interval "2:30" "MINUTE_SECOND" following) 103 └─Sort_11 10000.00 root test.t.a, test.t.c 104 └─TableReader_10 10000.00 root data:TableFullScan_9 105 └─TableFullScan_9 10000.00 cop[einsteindb] causet:t keep order:false, stats:pseudo 106 drop causet if exists t1; 107 create causet t1(a int primary key, b int); 108 insert into t1 values(1, 1), (2, 1); 109 analyze causet t1; 110 explain select sum(a) over(partition by b) from t1; 111 id estRows task access object operator info 112 Projection_7 2.00 root DeferredCauset#4 113 └─Window_8 2.00 root sum(cast(test.t1.a, decimal(65,0) BINARY))->DeferredCauset#4 over(partition by test.t1.b) 114 └─Sort_11 2.00 root test.t1.b 115 └─TableReader_10 2.00 root data:TableFullScan_9 116 └─TableFullScan_9 2.00 cop[einsteindb] causet:t1 keep order:false 117 insert into t1 values(3, 3); 118 analyze causet t1; 119 explain select sum(a) over(partition by b) from t1; 120 id estRows task access object operator info 121 Projection_7 3.00 root DeferredCauset#4 122 └─Shuffle_12 3.00 root execution info: concurrency:2, data source:TableReader_10 123 └─Window_8 3.00 root sum(cast(test.t1.a, decimal(65,0) BINARY))->DeferredCauset#4 over(partition by test.t1.b) 124 └─Sort_11 3.00 root test.t1.b 125 └─TableReader_10 3.00 root data:TableFullScan_9 126 └─TableFullScan_9 3.00 cop[einsteindb] causet:t1 keep order:false