:0[0]:W
Sexplain select count(a) from (select a from calldata group by a) x;
:2[0]:R
&1 0 304 1 304
% .explain # table_name
% mal # name
% clob # type
% 0 # length
=function user.s4_1{autoCommit=true}():void;
=barrier _420 := language.dataflow();
=    _35:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,0@0,29989390@0);
=    _6:bat[:oid,:int]  := sql.bind("smason","calldata","a",2);
=    _62 := algebra.kdifference(_35,_6);
=    _77 := algebra.semijoin(_6,_35);
=    _35:bat[:oid,:int]  := nil:BAT;
=    _104 := algebra.kunion(_62,_77);
=    _62 := nil:BAT;
=    _77 := nil:BAT;
=    _10:bat[:oid,:oid]  := sql.bind_dbat("smason","calldata",1);
=    _11 := bat.reverse(_10);
=    _10:bat[:oid,:oid]  := nil:BAT;
=    _121 := algebra.kdifference(_104,_11);
=    _104 := nil:BAT;
=    (_151,_152) := group.new(_121);
=    nil:BAT;
=    _197 := bat.mirror(_151);
=    _151 := nil:BAT;
=    _226 := algebra.join(_197,_121);
=    _197 := nil:BAT;
=    _37:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,29989390@0,59978780@0);
=    _64 := algebra.kdifference(_37,_6);
=    _79 := algebra.semijoin(_6,_37);
=    _37:bat[:oid,:int]  := nil:BAT;
=    _106 := algebra.kunion(_64,_79);
=    _64 := nil:BAT;
=    _79 := nil:BAT;
=    _123 := algebra.kdifference(_106,_11);
=    _106 := nil:BAT;
=    (_154,_155) := group.new(_123);
=    nil:BAT;
=    _200 := bat.mirror(_154);
=    _154 := nil:BAT;
=    _227 := algebra.join(_200,_123);
=    _200 := nil:BAT;
=    _39:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,59978780@0,89968170@0);
=    _65 := algebra.kdifference(_39,_6);
=    _81 := algebra.semijoin(_6,_39);
=    _39:bat[:oid,:int]  := nil:BAT;
=    _107 := algebra.kunion(_65,_81);
=    _65 := nil:BAT;
=    _81 := nil:BAT;
=    _125 := algebra.kdifference(_107,_11);
=    _107 := nil:BAT;
=    (_158,_159) := group.new(_125);
=    nil:BAT;
=    _202 := bat.mirror(_158);
=    _158 := nil:BAT;
=    _228 := algebra.join(_202,_125);
=    _202 := nil:BAT;
=    _41:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,89968170@0,119957560@0);
=    _66 := algebra.kdifference(_41,_6);
=    _83 := algebra.semijoin(_6,_41);
=    _41:bat[:oid,:int]  := nil:BAT;
=    _108 := algebra.kunion(_66,_83);
=    _66 := nil:BAT;
=    _83 := nil:BAT;
=    _127 := algebra.kdifference(_108,_11);
=    _108 := nil:BAT;
=    (_161,_162) := group.new(_127);
=    nil:BAT;
=    _204 := bat.mirror(_161);
=    _161 := nil:BAT;
=    _229 := algebra.join(_204,_127);
=    _204 := nil:BAT;
=    _43:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,119957560@0,149946950@0);
=    _67 := algebra.kdifference(_43,_6);
=    _85 := algebra.semijoin(_6,_43);
=    _43:bat[:oid,:int]  := nil:BAT;
=    _109 := algebra.kunion(_67,_85);
=    _67 := nil:BAT;
=    _85 := nil:BAT;
=    _129 := algebra.kdifference(_109,_11);
=    _109 := nil:BAT;
=    (_164,_165) := group.new(_129);
=    nil:BAT;
=    _206 := bat.mirror(_164);
=    _164 := nil:BAT;
=    _230 := algebra.join(_206,_129);
=    _206 := nil:BAT;
=    _45:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,149946950@0,179936340@0);
=    _68 := algebra.kdifference(_45,_6);
=    _87 := algebra.semijoin(_6,_45);
=    _45:bat[:oid,:int]  := nil:BAT;
=    _110 := algebra.kunion(_68,_87);
=    _68 := nil:BAT;
=    _87 := nil:BAT;
=    _131 := algebra.kdifference(_110,_11);
=    _110 := nil:BAT;
=    (_167,_168) := group.new(_131);
=    nil:BAT;
=    _208 := bat.mirror(_167);
=    _167 := nil:BAT;
=    _231 := algebra.join(_208,_131);
=    _208 := nil:BAT;
=    _47:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,179936340@0,209925730@0);
=    _69 := algebra.kdifference(_47,_6);
=    _89 := algebra.semijoin(_6,_47);
=    _47:bat[:oid,:int]  := nil:BAT;
=    _111 := algebra.kunion(_69,_89);
=    _69 := nil:BAT;
=    _89 := nil:BAT;
=    _133 := algebra.kdifference(_111,_11);
=    _111 := nil:BAT;
=    (_170,_171) := group.new(_133);
=    nil:BAT;
=    _210 := bat.mirror(_170);
=    _170 := nil:BAT;
=    _232 := algebra.join(_210,_133);
=    _210 := nil:BAT;
=    _49:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,209925730@0,239915120@0);
=    _70 := algebra.kdifference(_49,_6);
=    _91 := algebra.semijoin(_6,_49);
=    _49:bat[:oid,:int]  := nil:BAT;
=    _112 := algebra.kunion(_70,_91);
=    _70 := nil:BAT;
=    _91 := nil:BAT;
=    _135 := algebra.kdifference(_112,_11);
=    _112 := nil:BAT;
=    (_173,_174) := group.new(_135);
=    nil:BAT;
=    _212 := bat.mirror(_173);
=    _173 := nil:BAT;
=    _233 := algebra.join(_212,_135);
=    _212 := nil:BAT;
=    _51:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,239915120@0,269904510@0);
=    _71 := algebra.kdifference(_51,_6);
=    _93 := algebra.semijoin(_6,_51);
=    _51:bat[:oid,:int]  := nil:BAT;
=    _113 := algebra.kunion(_71,_93);
=    _71 := nil:BAT;
=    _93 := nil:BAT;
=    _137 := algebra.kdifference(_113,_11);
=    _113 := nil:BAT;
=    (_176,_177) := group.new(_137);
=    nil:BAT;
=    _214 := bat.mirror(_176);
=    _176 := nil:BAT;
=    _234 := algebra.join(_214,_137);
=    _214 := nil:BAT;
=    _53:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,269904510@0,299893900@0);
=    _72 := algebra.kdifference(_53,_6);
=    _95 := algebra.semijoin(_6,_53);
=    _53:bat[:oid,:int]  := nil:BAT;
=    _114 := algebra.kunion(_72,_95);
=    _72 := nil:BAT;
=    _95 := nil:BAT;
=    _139 := algebra.kdifference(_114,_11);
=    _114 := nil:BAT;
=    (_179,_180) := group.new(_139);
=    nil:BAT;
=    _216 := bat.mirror(_179);
=    _179 := nil:BAT;
=    _235 := algebra.join(_216,_139);
=    _216 := nil:BAT;
=    _55:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,299893900@0,329883290@0);
=    _73 := algebra.kdifference(_55,_6);
=    _97 := algebra.semijoin(_6,_55);
=    _55:bat[:oid,:int]  := nil:BAT;
=    _115 := algebra.kunion(_73,_97);
=    _73 := nil:BAT;
=    _97 := nil:BAT;
=    _141 := algebra.kdifference(_115,_11);
=    _115 := nil:BAT;
=    (_182,_183) := group.new(_141);
=    nil:BAT;
=    _218 := bat.mirror(_182);
=    _182 := nil:BAT;
=    _236 := algebra.join(_218,_141);
=    _218 := nil:BAT;
=    _57:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,329883290@0,359872680@0);
=    _74 := algebra.kdifference(_57,_6);
=    _99 := algebra.semijoin(_6,_57);
=    _57:bat[:oid,:int]  := nil:BAT;
=    _116 := algebra.kunion(_74,_99);
=    _74 := nil:BAT;
=    _99 := nil:BAT;
=    _143 := algebra.kdifference(_116,_11);
=    _116 := nil:BAT;
=    (_185,_186) := group.new(_143);
=    nil:BAT;
=    _220 := bat.mirror(_185);
=    _185 := nil:BAT;
=    _237 := algebra.join(_220,_143);
=    _220 := nil:BAT;
=    _59:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,359872680@0,389862070@0);
=    _75 := algebra.kdifference(_59,_6);
=    _101 := algebra.semijoin(_6,_59);
=    _59:bat[:oid,:int]  := nil:BAT;
=    _117 := algebra.kunion(_75,_101);
=    _75 := nil:BAT;
=    _101 := nil:BAT;
=    _145 := algebra.kdifference(_117,_11);
=    _117 := nil:BAT;
=    (_188,_189) := group.new(_145);
=    nil:BAT;
=    _222 := bat.mirror(_188);
=    _188 := nil:BAT;
=    _238 := algebra.join(_222,_145);
=    _222 := nil:BAT;
=    _61:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,389862070@0,nil:oid);
=    _76 := algebra.kdifference(_61,_6);
=    _103 := algebra.semijoin(_6,_61);
=    _6:bat[:oid,:int]  := nil:BAT;
=    _61:bat[:oid,:int]  := nil:BAT;
=    _118 := algebra.kunion(_76,_103);
=    _76 := nil:BAT;
=    _103 := nil:BAT;
=    _147 := algebra.kdifference(_118,_11);
=    _118 := nil:BAT;
=    (_191,_192) := group.new(_147);
=    nil:BAT;
=    _224 := bat.mirror(_191);
=    _191 := nil:BAT;
=    _239 := algebra.join(_224,_147);
=    _224 := nil:BAT;
=    _8:bat[:oid,:int]  := sql.bind("smason","calldata","a",1);
=    _148 := algebra.kdifference(_8,_11);
=    _8:bat[:oid,:int]  := nil:BAT;
=    _11 := nil:BAT;
=    (_193,_194) := group.new(_148);
=    nil:BAT;
=    _225 := bat.mirror(_193);
=    _193 := nil:BAT;
=    _240 := algebra.join(_225,_148);
=    _225 := nil:BAT;
=    _241 := mat.pack(_226,_227,_228,_229,_230,_231,_232,_233,_234,_235,_236,_237,_238,_239,_240);
=    _226 := nil:BAT;
=    _227 := nil:BAT;
=    _228 := nil:BAT;
=    _229 := nil:BAT;
=    _230 := nil:BAT;
=    _231 := nil:BAT;
=    _232 := nil:BAT;
=    _233 := nil::14[0]:R
BAT;
=    _234 := nil:BAT;
=    _235 := nil:BAT;
=    _236 := nil:BAT;
=    _237 := nil:BAT;
=    _238 := nil:BAT;
=    _239 := nil:BAT;
=    _240 := nil:BAT;
=    (ext19,grp17) := group.new(_241);
=    grp17 := nil:BAT;
=    _241 := nil:BAT;
=    _14 := bat.mirror(ext19);
=    ext19 := nil:BAT;
=    _243 := algebra.join(_14,_121);
=    _121 := nil:BAT;
=    _244 := algebra.join(_14,_123);
=    _123 := nil:BAT;
=    _245 := algebra.join(_14,_125);
=    _125 := nil:BAT;
=    _246 := algebra.join(_14,_127);
=    _127 := nil:BAT;
=    _247 := algebra.join(_14,_129);
=    _129 := nil:BAT;
=    _248 := algebra.join(_14,_131);
=    _131 := nil:BAT;
=    _249 := algebra.join(_14,_133);
=    _133 := nil:BAT;
=    _250 := algebra.join(_14,_135);
=    _135 := nil:BAT;
=    _251 := algebra.join(_14,_137);
=    _137 := nil:BAT;
=    _252 := algebra.join(_14,_139);
=    _139 := nil:BAT;
=    _253 := algebra.join(_14,_141);
=    _141 := nil:BAT;
=    _254 := algebra.join(_14,_143);
=    _143 := nil:BAT;
=    _255 := algebra.join(_14,_145);
=    _145 := nil:BAT;
=    _256 := algebra.join(_14,_147);
=    _147 := nil:BAT;
=    _257 := algebra.join(_14,_148);
=    _148 := nil:BAT;
=    _242 := mat.pack(_243,_244,_245,_246,_247,_248,_249,_250,_251,_252,_253,_254,_255,_256,_257);
=    _243 := nil:BAT;
=    _244 := nil:BAT;
=    _245 := nil:BAT;
=    _246 := nil:BAT;
=    _247 := nil:BAT;
=    _248 := nil:BAT;
=    _249 := nil:BAT;
=    _250 := nil:BAT;
=    _251 := nil:BAT;
=    _252 := nil:BAT;
=    _253 := nil:BAT;
=    _254 := nil:BAT;
=    _255 := nil:BAT;
=    _256 := nil:BAT;
=    _257 := nil:BAT;
=    _15 := algebra.join(_14,_242);
=    _14 := nil:BAT;
=    _242 := nil:BAT;
=    _16 := algebra.selectNotNil(_15);
=    _15 := nil:BAT;
=    _17 := aggr.count(_16);
=    _16 := nil:BAT;
=exit _420;
=    sql.exportValue(1,"smason.x","L44","wrd",32,0,6,_17,"");
=end s4_1;
:14[0]:R
:14[0]:W
Xclose 0
:14[0]:R
:8610[0]:W
Sexplain select count(a) from (select distinct a from calldata) x;
:8611[0]:R
&1 0 304 1 304
% .explain # table_name
% mal # name
% clob # type
% 0 # length
=function user.s5_1{autoCommit=true}():void;
=barrier _420 := language.dataflow();
=    _35:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,0@0,29989390@0);
=    _6:bat[:oid,:int]  := sql.bind("smason","calldata","a",2);
=    _62 := algebra.kdifference(_35,_6);
=    _77 := algebra.semijoin(_6,_35);
=    _35:bat[:oid,:int]  := nil:BAT;
=    _104 := algebra.kunion(_62,_77);
=    _62 := nil:BAT;
=    _77 := nil:BAT;
=    _10:bat[:oid,:oid]  := sql.bind_dbat("smason","calldata",1);
=    _11 := bat.reverse(_10);
=    _10:bat[:oid,:oid]  := nil:BAT;
=    _121 := algebra.kdifference(_104,_11);
=    _104 := nil:BAT;
=    (_151,_152) := group.new(_121);
=    nil:BAT;
=    _197 := bat.mirror(_151);
=    _151 := nil:BAT;
=    _226 := algebra.join(_197,_121);
=    _197 := nil:BAT;
=    _37:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,29989390@0,59978780@0);
=    _64 := algebra.kdifference(_37,_6);
=    _79 := algebra.semijoin(_6,_37);
=    _37:bat[:oid,:int]  := nil:BAT;
=    _106 := algebra.kunion(_64,_79);
=    _64 := nil:BAT;
=    _79 := nil:BAT;
=    _123 := algebra.kdifference(_106,_11);
=    _106 := nil:BAT;
=    (_154,_155) := group.new(_123);
=    nil:BAT;
=    _200 := bat.mirror(_154);
=    _154 := nil:BAT;
=    _227 := algebra.join(_200,_123);
=    _200 := nil:BAT;
=    _39:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,59978780@0,89968170@0);
=    _65 := algebra.kdifference(_39,_6);
=    _81 := algebra.semijoin(_6,_39);
=    _39:bat[:oid,:int]  := nil:BAT;
=    _107 := algebra.kunion(_65,_81);
=    _65 := nil:BAT;
=    _81 := nil:BAT;
=    _125 := algebra.kdifference(_107,_11);
=    _107 := nil:BAT;
=    (_158,_159) := group.new(_125);
=    nil:BAT;
=    _202 := bat.mirror(_158);
=    _158 := nil:BAT;
=    _228 := algebra.join(_202,_125);
=    _202 := nil:BAT;
=    _41:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,89968170@0,119957560@0);
=    _66 := algebra.kdifference(_41,_6);
=    _83 := algebra.semijoin(_6,_41);
=    _41:bat[:oid,:int]  := nil:BAT;
=    _108 := algebra.kunion(_66,_83);
=    _66 := nil:BAT;
=    _83 := nil:BAT;
=    _127 := algebra.kdifference(_108,_11);
=    _108 := nil:BAT;
=    (_161,_162) := group.new(_127);
=    nil:BAT;
=    _204 := bat.mirror(_161);
=    _161 := nil:BAT;
=    _229 := algebra.join(_204,_127);
=    _204 := nil:BAT;
=    _43:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,119957560@0,149946950@0);
=    _67 := algebra.kdifference(_43,_6);
=    _85 := algebra.semijoin(_6,_43);
=    _43:bat[:oid,:int]  := nil:BAT;
=    _109 := algebra.kunion(_67,_85);
=    _67 := nil:BAT;
=    _85 := nil:BAT;
=    _129 := algebra.kdifference(_109,_11);
=    _109 := nil:BAT;
=    (_164,_165) := group.new(_129);
=    nil:BAT;
=    _206 := bat.mirror(_164);
=    _164 := nil:BAT;
=    _230 := algebra.join(_206,_129);
=    _206 := nil:BAT;
=    _45:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,149946950@0,179936340@0);
=    _68 := algebra.kdifference(_45,_6);
=    _87 := algebra.semijoin(_6,_45);
=    _45:bat[:oid,:int]  := nil:BAT;
=    _110 := algebra.kunion(_68,_87);
=    _68 := nil:BAT;
=    _87 := nil:BAT;
=    _131 := algebra.kdifference(_110,_11);
=    _110 := nil:BAT;
=    (_167,_168) := group.new(_131);
=    nil:BAT;
=    _208 := bat.mirror(_167);
=    _167 := nil:BAT;
=    _231 := algebra.join(_208,_131);
=    _208 := nil:BAT;
=    _47:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,179936340@0,209925730@0);
=    _69 := algebra.kdifference(_47,_6);
=    _89 := algebra.semijoin(_6,_47);
=    _47:bat[:oid,:int]  := nil:BAT;
=    _111 := algebra.kunion(_69,_89);
=    _69 := nil:BAT;
=    _89 := nil:BAT;
=    _133 := algebra.kdifference(_111,_11);
=    _111 := nil:BAT;
=    (_170,_171) := group.new(_133);
=    nil:BAT;
=    _210 := bat.mirror(_170);
=    _170 := nil:BAT;
=    _232 := algebra.join(_210,_133);
=    _210 := nil:BAT;
=    _49:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,209925730@0,239915120@0);
=    _70 := algebra.kdifference(_49,_6);
=    _91 := algebra.semijoin(_6,_49);
=    _49:bat[:oid,:int]  := nil:BAT;
=    _112 := algebra.kunion(_70,_91);
=    _70 := nil:BAT;
=    _91 := nil:BAT;
=    _135 := algebra.kdifference(_112,_11);
=    _112 := nil:BAT;
=    (_173,_174) := group.new(_135);
=    nil:BAT;
=    _212 := bat.mirror(_173);
=    _173 := nil:BAT;
=    _233 := algebra.join(_212,_135);
=    _212 := nil:BAT;
=    _51:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,239915120@0,269904510@0);
=    _71 := algebra.kdifference(_51,_6);
=    _93 := algebra.semijoin(_6,_51);
=    _51:bat[:oid,:int]  := nil:BAT;
=    _113 := algebra.kunion(_71,_93);
=    _71 := nil:BAT;
=    _93 := nil:BAT;
=    _137 := algebra.kdifference(_113,_11);
=    _113 := nil:BAT;
=    (_176,_177) := group.new(_137);
=    nil:BAT;
=    _214 := bat.mirror(_176);
=    _176 := nil:BAT;
=    _234 := algebra.join(_214,_137);
=    _214 := nil:BAT;
=    _53:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,269904510@0,299893900@0);
=    _72 := algebra.kdifference(_53,_6);
=    _95 := algebra.semijoin(_6,_53);
=    _53:bat[:oid,:int]  := nil:BAT;
=    _114 := algebra.kunion(_72,_95);
=    _72 := nil:BAT;
=    _95 := nil:BAT;
=    _139 := algebra.kdifference(_114,_11);
=    _114 := nil:BAT;
=    (_179,_180) := group.new(_139);
=    nil:BAT;
=    _216 := bat.mirror(_179);
=    _179 := nil:BAT;
=    _235 := algebra.join(_216,_139);
=    _216 := nil:BAT;
=    _55:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,299893900@0,329883290@0);
=    _73 := algebra.kdifference(_55,_6);
=    _97 := algebra.semijoin(_6,_55);
=    _55:bat[:oid,:int]  := nil:BAT;
=    _115 := algebra.kunion(_73,_97);
=    _73 := nil:BAT;
=    _97 := nil:BAT;
=    _141 := algebra.kdifference(_115,_11);
=    _115 := nil:BAT;
=    (_182,_183) := group.new(_141);
=    nil:BAT;
=    _218 := bat.mirror(_182);
=    _182 := nil:BAT;
=    _236 := algebra.join(_218,_141);
=    _218 := nil:BAT;
=    _57:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,329883290@0,359872680@0);
=    _74 := algebra.kdifference(_57,_6);
=    _99 := algebra.semijoin(_6,_57);
=    _57:bat[:oid,:int]  := nil:BAT;
=    _116 := algebra.kunion(_74,_99);
=    _74 := nil:BAT;
=    _99 := nil:BAT;
=    _143 := algebra.kdifference(_116,_11);
=    _116 := nil:BAT;
=    (_185,_186) := group.new(_143);
=    nil:BAT;
=    _220 := bat.mirror(_185);
=    _185 := nil:BAT;
=    _237 := algebra.join(_220,_143);
=    _220 := nil:BAT;
=    _59:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,359872680@0,389862070@0);
=    _75 := algebra.kdifference(_59,_6);
=    _101 := algebra.semijoin(_6,_59);
=    _59:bat[:oid,:int]  := nil:BAT;
=    _117 := algebra.kunion(_75,_101);
=    _75 := nil:BAT;
=    _101 := nil:BAT;
=    _145 := algebra.kdifference(_117,_11);
=    _117 := nil:BAT;
=    (_188,_189) := group.new(_145);
=    nil:BAT;
=    _222 := bat.mirror(_188);
=    _188 := nil:BAT;
=    _238 := algebra.join(_222,_145);
=    _222 := nil:BAT;
=    _61:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,389862070@0,nil:oid);
=    _76 := algebra.kdifference(_61,_6);
=    _103 := algebra.semijoin(_6,_61);
=    _6:bat[:oid,:int]  := nil:BAT;
=    _61:bat[:oid,:int]  := nil:BAT;
=    _118 := algebra.kunion(_76,_103);
=    _76 := nil:BAT;
=    _103 := nil:BAT;
=    _147 := algebra.kdifference(_118,_11);
=    _118 := nil:BAT;
=    (_191,_192) := group.new(_147);
=    nil:BAT;
=    _224 := bat.mirror(_191);
=    _191 := nil:BAT;
=    _239 := algebra.join(_224,_147);
=    _224 := nil:BAT;
=    _8:bat[:oid,:int]  := sql.bind("smason","calldata","a",1);
=    _148 := algebra.kdifference(_8,_11);
=    _8:bat[:oid,:int]  := nil:BAT;
=    _11 := nil:BAT;
=    (_193,_194) := group.new(_148);
=    nil:BAT;
=    _225 := bat.mirror(_193);
=    _193 := nil:BAT;
=    _240 := algebra.join(_225,_148);
=    _225 := nil:BAT;
=    _241 := mat.pack(_226,_227,_228,_229,_230,_231,_232,_233,_234,_235,_236,_237,_238,_239,_240);
=    _226 := nil:BAT;
=    _227 := nil:BAT;
=    _228 := nil:BAT;
=    _229 := nil:BAT;
=    _230 := nil:BAT;
=    _231 := nil:BAT;
=    _232 := nil:BAT;
=    _233 := nil::8623[0]:R
BAT;
=    _234 := nil:BAT;
=    _235 := nil:BAT;
=    _236 := nil:BAT;
=    _237 := nil:BAT;
=    _238 := nil:BAT;
=    _239 := nil:BAT;
=    _240 := nil:BAT;
=    (ext19,grp17) := group.new(_241);
=    grp17 := nil:BAT;
=    _241 := nil:BAT;
=    _14 := bat.mirror(ext19);
=    ext19 := nil:BAT;
=    _243 := algebra.join(_14,_121);
=    _121 := nil:BAT;
=    _244 := algebra.join(_14,_123);
=    _123 := nil:BAT;
=    _245 := algebra.join(_14,_125);
=    _125 := nil:BAT;
=    _246 := algebra.join(_14,_127);
=    _127 := nil:BAT;
=    _247 := algebra.join(_14,_129);
=    _129 := nil:BAT;
=    _248 := algebra.join(_14,_131);
=    _131 := nil:BAT;
=    _249 := algebra.join(_14,_133);
=    _133 := nil:BAT;
=    _250 := algebra.join(_14,_135);
=    _135 := nil:BAT;
=    _251 := algebra.join(_14,_137);
=    _137 := nil:BAT;
=    _252 := algebra.join(_14,_139);
=    _139 := nil:BAT;
=    _253 := algebra.join(_14,_141);
=    _141 := nil:BAT;
=    _254 := algebra.join(_14,_143);
=    _143 := nil:BAT;
=    _255 := algebra.join(_14,_145);
=    _145 := nil:BAT;
=    _256 := algebra.join(_14,_147);
=    _147 := nil:BAT;
=    _257 := algebra.join(_14,_148);
=    _148 := nil:BAT;
=    _242 := mat.pack(_243,_244,_245,_246,_247,_248,_249,_250,_251,_252,_253,_254,_255,_256,_257);
=    _243 := nil:BAT;
=    _244 := nil:BAT;
=    _245 := nil:BAT;
=    _246 := nil:BAT;
=    _247 := nil:BAT;
=    _248 := nil:BAT;
=    _249 := nil:BAT;
=    _250 := nil:BAT;
=    _251 := nil:BAT;
=    _252 := nil:BAT;
=    _253 := nil:BAT;
=    _254 := nil:BAT;
=    _255 := nil:BAT;
=    _256 := nil:BAT;
=    _257 := nil:BAT;
=    _15 := algebra.join(_14,_242);
=    _14 := nil:BAT;
=    _242 := nil:BAT;
=    _16 := algebra.selectNotNil(_15);
=    _15 := nil:BAT;
=    _17 := aggr.count(_16);
=    _16 := nil:BAT;
=exit _420;
=    sql.exportValue(1,"smason.x","L45","wrd",32,0,6,_17,"");
=end s5_1;
:8623[0]:R
:8623[0]:W
Xclose 0
:8623[0]:R
:16380[0]:W
Sexplain select count(distinct a) from calldata;
:16381[0]:R
&1 0 224 1 224
% .explain # table_name
% mal # name
% clob # type
% 0 # length
=function user.s6_1{autoCommit=true}():void;
=barrier _309 := language.dataflow();
=    _35:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,0@0,29989390@0);
=    _62 := algebra.selectNotNil(_35);
=    _6:bat[:oid,:int]  := sql.bind("smason","calldata","a",2);
=    _77 := algebra.kdifference(_62,_6);
=    _62 := nil:BAT;
=    _8 := algebra.selectNotNil(_6);
=    _104 := algebra.semijoin(_8,_35);
=    _35:bat[:oid,:int]  := nil:BAT;
=    _119 := algebra.kunion(_77,_104);
=    _77 := nil:BAT;
=    _104 := nil:BAT;
=    _12:bat[:oid,:oid]  := sql.bind_dbat("smason","calldata",1);
=    _13 := bat.reverse(_12);
=    _12:bat[:oid,:oid]  := nil:BAT;
=    _150 := algebra.kdifference(_119,_13);
=    _119 := nil:BAT;
=    _181 := bat.reverse(_150);
=    _150 := nil:BAT;
=    _37:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,29989390@0,59978780@0);
=    _64 := algebra.selectNotNil(_37);
=    _79 := algebra.kdifference(_64,_6);
=    _64 := nil:BAT;
=    _106 := algebra.semijoin(_8,_37);
=    _37:bat[:oid,:int]  := nil:BAT;
=    _121 := algebra.kunion(_79,_106);
=    _79 := nil:BAT;
=    _106 := nil:BAT;
=    _152 := algebra.kdifference(_121,_13);
=    _121 := nil:BAT;
=    _182 := bat.reverse(_152);
=    _152 := nil:BAT;
=    _39:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,59978780@0,89968170@0);
=    _65 := algebra.selectNotNil(_39);
=    _81 := algebra.kdifference(_65,_6);
=    _65 := nil:BAT;
=    _107 := algebra.semijoin(_8,_39);
=    _39:bat[:oid,:int]  := nil:BAT;
=    _123 := algebra.kunion(_81,_107);
=    _81 := nil:BAT;
=    _107 := nil:BAT;
=    _154 := algebra.kdifference(_123,_13);
=    _123 := nil:BAT;
=    _183 := bat.reverse(_154);
=    _154 := nil:BAT;
=    _41:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,89968170@0,119957560@0);
=    _66 := algebra.selectNotNil(_41);
=    _83 := algebra.kdifference(_66,_6);
=    _66 := nil:BAT;
=    _108 := algebra.semijoin(_8,_41);
=    _41:bat[:oid,:int]  := nil:BAT;
=    _125 := algebra.kunion(_83,_108);
=    _83 := nil:BAT;
=    _108 := nil:BAT;
=    _156 := algebra.kdifference(_125,_13);
=    _125 := nil:BAT;
=    _184 := bat.reverse(_156);
=    _156 := nil:BAT;
=    _43:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,119957560@0,149946950@0);
=    _67 := algebra.selectNotNil(_43);
=    _85 := algebra.kdifference(_67,_6);
=    _67 := nil:BAT;
=    _109 := algebra.semijoin(_8,_43);
=    _43:bat[:oid,:int]  := nil:BAT;
=    _127 := algebra.kunion(_85,_109);
=    _85 := nil:BAT;
=    _109 := nil:BAT;
=    _158 := algebra.kdifference(_127,_13);
=    _127 := nil:BAT;
=    _185 := bat.reverse(_158);
=    _158 := nil:BAT;
=    _45:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,149946950@0,179936340@0);
=    _68 := algebra.selectNotNil(_45);
=    _87 := algebra.kdifference(_68,_6);
=    _68 := nil:BAT;
=    _110 := algebra.semijoin(_8,_45);
=    _45:bat[:oid,:int]  := nil:BAT;
=    _129 := algebra.kunion(_87,_110);
=    _87 := nil:BAT;
=    _110 := nil:BAT;
=    _160 := algebra.kdifference(_129,_13);
=    _129 := nil:BAT;
=    _186 := bat.reverse(_160);
=    _160 := nil:BAT;
=    _47:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,179936340@0,209925730@0);
=    _69 := algebra.selectNotNil(_47);
=    _89 := algebra.kdifference(_69,_6);
=    _69 := nil:BAT;
=    _111 := algebra.semijoin(_8,_47);
=    _47:bat[:oid,:int]  := nil:BAT;
=    _131 := algebra.kunion(_89,_111);
=    _89 := nil:BAT;
=    _111 := nil:BAT;
=    _162 := algebra.kdifference(_131,_13);
=    _131 := nil:BAT;
=    _187 := bat.reverse(_162);
=    _162 := nil:BAT;
=    _49:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,209925730@0,239915120@0);
=    _70 := algebra.selectNotNil(_49);
=    _91 := algebra.kdifference(_70,_6);
=    _70 := nil:BAT;
=    _112 := algebra.semijoin(_8,_49);
=    _49:bat[:oid,:int]  := nil:BAT;
=    _133 := algebra.kunion(_91,_112);
=    _91 := nil:BAT;
=    _112 := nil:BAT;
=    _164 := algebra.kdifference(_133,_13);
=    _133 := nil:BAT;
=    _188 := bat.reverse(_164);
=    _164 := nil:BAT;
=    _51:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,239915120@0,269904510@0);
=    _71 := algebra.selectNotNil(_51);
=    _93 := algebra.kdifference(_71,_6);
=    _71 := nil:BAT;
=    _113 := algebra.semijoin(_8,_51);
=    _51:bat[:oid,:int]  := nil:BAT;
=    _135 := algebra.kunion(_93,_113);
=    _93 := nil:BAT;
=    _113 := nil:BAT;
=    _166 := algebra.kdifference(_135,_13);
=    _135 := nil:BAT;
=    _189 := bat.reverse(_166);
=    _166 := nil:BAT;
=    _53:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,269904510@0,299893900@0);
=    _72 := algebra.selectNotNil(_53);
=    _95 := algebra.kdifference(_72,_6);
=    _72 := nil:BAT;
=    _114 := algebra.semijoin(_8,_53);
=    _53:bat[:oid,:int]  := nil:BAT;
=    _137 := algebra.kunion(_95,_114);
=    _95 := nil:BAT;
=    _114 := nil:BAT;
=    _168 := algebra.kdifference(_137,_13);
=    _137 := nil:BAT;
=    _190 := bat.reverse(_168);
=    _168 := nil:BAT;
=    _55:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,299893900@0,329883290@0);
=    _73 := algebra.selectNotNil(_55);
=    _97 := algebra.kdifference(_73,_6);
=    _73 := nil:BAT;
=    _115 := algebra.semijoin(_8,_55);
=    _55:bat[:oid,:int]  := nil:BAT;
=    _139 := algebra.kunion(_97,_115);
=    _97 := nil:BAT;
=    _115 := nil:BAT;
=    _170 := algebra.kdifference(_139,_13);
=    _139 := nil:BAT;
=    _191 := bat.reverse(_170);
=    _170 := nil:BAT;
=    _57:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,329883290@0,359872680@0);
=    _74 := algebra.selectNotNil(_57);
=    _99 := algebra.kdifference(_74,_6);
=    _74 := nil:BAT;
=    _116 := algebra.semijoin(_8,_57);
=    _57:bat[:oid,:int]  := nil:BAT;
=    _141 := algebra.kunion(_99,_116);
=    _99 := nil:BAT;
=    _116 := nil:BAT;
=    _172 := algebra.kdifference(_141,_13);
=    _141 := nil:BAT;
=    _192 := bat.reverse(_172);
=    _172 := nil:BAT;
=    _59:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,359872680@0,389862070@0);
=    _75 := algebra.selectNotNil(_59);
=    _101 := algebra.kdifference(_75,_6);
=    _75 := nil:BAT;
=    _117 := algebra.semijoin(_8,_59);
=    _59:bat[:oid,:int]  := nil:BAT;
=    _143 := algebra.kunion(_101,_117);
=    _101 := nil:BAT;
=    _117 := nil:BAT;
=    _174 := algebra.kdifference(_143,_13);
=    _143 := nil:BAT;
=    _193 := bat.reverse(_174);
=    _174 := nil:BAT;
=    _61:bat[:oid,:int]  := sql.bind("smason","calldata","a",0,389862070@0,nil:oid);
=    _76 := algebra.selectNotNil(_61);
=    _103 := algebra.kdifference(_76,_6);
=    _76 := nil:BAT;
=    _6:bat[:oid,:int]  := nil:BAT;
=    _118 := algebra.semijoin(_8,_61);
=    _8 := nil:BAT;
=    _61:bat[:oid,:int]  := nil:BAT;
=    _145 := algebra.kunion(_103,_118);
=    _103 := nil:BAT;
=    _118 := nil:BAT;
=    _176 := algebra.kdifference(_145,_13);
=    _145 := nil:BAT;
=    _194 := bat.reverse(_176);
=    _176 := nil:BAT;
=    _9:bat[:oid,:int]  := sql.bind("smason","calldata","a",1);
=    _11 := algebra.selectNotNil(_9);
=    _9:bat[:oid,:int]  := nil:BAT;
=    _178 := algebra.kdifference(_11,_13);
=    _11 := nil:BAT;
=    _13 := nil:BAT;
=    _195 := bat.reverse(_178);
=    _178 := nil:BAT;
=    _14 := mat.pack(_181,_182,_183,_184,_185,_186,_187,_188,_189,_190,_191,_192,_193,_194,_195);
=    _181 := nil:BAT;
=    _182 := nil:BAT;
=    _183 := nil:BAT;
=    _184 := nil:BAT;
=    _185 := nil:BAT;
=    _186 := nil:BAT;
=    _187 := nil:BAT;
=    _188 := nil:BAT;
=    _189 := nil:BAT;
=    _190 := nil:BAT;
=    _191 := nil:BAT;
=    _192 := nil:BAT;
=    _193 := nil:BAT;
=    _194 := nil:BAT;
=    _195 := nil:BAT;
=    _15 := algebra.kunique(_14);
=    _14 := nil:BAT;
=    _16 := bat.reverse(_15);
=    _15 := nil:BAT;
=    _17 := aggr.count(_16);
=    _16 := nil:BAT;
=exit _309;
=    sql.exportValue(1,"smason.calldata","L46","wrd",32,0,6,_17,"");
=end s6_1;
:16393[0]:R
:16393[0]:W
Xclose 0
:16393[0]:R
:17660[0]:W
Connection closed
