paulr135 wrote:
I'll issue this command over the weekend when I don't have anything
planned for this machine.
Here is the output from this command:
sql>trace ALTER TABLE table1 ADD CONSTRAINT table1_pkey PRIMARY KEY
(opc,session_id,session_start,domain_id);
operation successful
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| ticks | stmt
|
+===============+==========================================================================================================================================+
| 2 | _2 := sql.mvc();
|
| 31639286 | sql.catalog(29,"sys",46912720421368,0);
|
| 17078 | _50:bat[:oid,:int] [164680974] :=
sql.bind(_2=265069960,"sys","table1","session_start",0);
|
| 7 | _51:bat[:oid,:oid] [0] :=
sql.bind_dbat(_2=265069960,"sys","table1",1);
|
| 19628 | _57:bat[:oid,:int] [164680974] :=
sql.bind(_2=265069960,"sys","table1","domain_id",0);
|
| 2 | _40:bat[:oid,:oid] [0] :=
sql.bind_dbat(_2=265069960,"sys","table1",1);
|
| 23480 | _53[0] := bat.reverse(_51=nil:bat[:oid,:oid]);
|
| 10 | _37:bat[:oid,:str] [164680974] :=
sql.bind(_2=265069960,"sys","table1","opc",0);
|
| 2 | _42[0] := bat.reverse(_40=nil:bat[:oid,:oid]);
|
| 4 | _29:bat[:oid,:int] [164680974] :=
sql.bind(_2=265069960,"sys","table1","domain_id",0);
|
| 2 | _24:bat[:oid,:int] [164680974] :=
sql.bind(_2=265069960,"sys","table1","session_start",0);
|
| 166240 | _54[164680974] :=
algebra.kdifference(_50=nil:bat[:oid,:int],_53=[0]);
|
| 9 | _60[164680974] :=
algebra.kdifference(_57=nil:bat[:oid,:int],_53=nil);
|
| 6 | _10:bat[:oid,:oid] [0] :=
sql.bind_dbat(_2=265069960,"sys","table1",1);
|
| 3 | _12[0] := bat.reverse(_10=nil:bat[:oid,:oid]);
|
| 6 | _7:bat[:oid,:str] [164680974] :=
sql.bind(_2=265069960,"sys","table1","opc",0);
|
| 11 | _13[164680974] :=
algebra.kdifference(_7=nil:bat[:oid,:str],_12=nil);
|
| 6 | _14[164680974] :=
algebra.markT(_13=[164680974],40@0);
|
| 10 | _43[164680974] :=
algebra.kdifference(_37=nil:bat[:oid,:str],_42=[0]);
|
| 2 | _19[164680974] :=
bat.reverse(_14=[164680974]);
|
| 919879 | _27[164680974] :=
algebra.join(_19=[164680974],_24=nil:bat[:oid,:int]);
|
| 6 | _15[164680974] := bat.reverse(_13=nil);
|
| 26 | _16[164680974] := algebra.markT(_15=nil,40@0);
|
| 2 | _17[164680974] := bat.reverse(_16=nil);
|
| 2485261 | _46:bat[:oid,:str] [164680974] :=
sql.bind(_2=265069960,"sys","table1","session_id",0);
|
| 2400816 | _20:bat[:oid,:str] [164680974] :=
sql.bind(_2=265069960,"sys","table1","session_id",0);
|
| 433385817 | _18:bat[:oid,:wrd] [164680974] :=
batcalc.hash(_17=nil);
|
| 694328 | _22[164680974] :=
algebra.join(_19=[164680974],_20=nil:bat[:oid,:str]);
|
| 124881 | _47[164680974] :=
algebra.kdifference(_46=nil:bat[:oid,:str],_42=nil);
|
| 342530876 | _23:bat[:oid,:wrd] [164680974] :=
mkey.bulk_rotate_xor_hash(_18=nil:bat[:oid,:wrd],13,_22=nil);
|
| 69012 | _32[164680974] :=
algebra.join(_19=nil,_29=nil:bat[:oid,:int]);
|
| 154609537 | _28:bat[:oid,:wrd] [164680974] :=
mkey.bulk_rotate_xor_hash(_23=nil:bat[:oid,:wrd],13,_27=nil);
|
| 164904736 | _33:bat[:oid,:wrd] [164680974] :=
mkey.bulk_rotate_xor_hash(_28=nil:bat[:oid,:wrd],13,_32=nil);
|
| 64829749 | _34[164680974] :=
algebra.join(_14=nil,_33=nil:bat[:oid,:wrd]);
|
| 2076716851584 | (ext50[164680974],grp48[164680974]) :=
group.new(_34=[164680974]);
|
| 98080 | (ext60[164680974],grp58[164680974]) :=
group.derive(ext50=nil,grp48=nil,_43=nil);
|
| 31141 | (ext67[164680974],grp65[164680974]) :=
group.derive(ext60=nil,grp58=nil,_47=nil);
|
| 17406 | (ext75[164680974],grp73[164680974]) :=
group.derive(ext67=nil,grp65=nil,_54=nil);
|
| 12755 | (ext84[164680974],grp82[164680974]) :=
group.done(ext75=nil,grp73=nil,_60=nil);
|
| 19898 | _63[164680974] := bat.mirror(ext84=nil);
|
| 441620849 | _64:bat[:oid,:wrd] [164680974] :=
aggr.count(grp82=nil,grp82=nil,_63=nil);
|
| 34240 | _65 :=
aggr.count(_64=:bat[:oid,:wrd][164680974]);
|
| 18001302 | return sum := aggr.sum(b=[164680974],true);
|
| 22537773 | _66:wrd := aggr.sum(_64=nil:bat[:oid,:wrd]);
|
| 39809 | _67 := calc.isnil(_66=164680974:wrd);
|
| 8 | _68 := calc.ifthenelse(_67=false,0:wrd,_66=164680974:wrd);
|
| 3 | _69 := calc.!=(_65=164680974:wrd,_68=164680974:wrd);
|
| 2078347613459 | barrier _92 := language.dataflow();
|
| 30002 | sql.assert(_69=false,"UPDATE: PRIMARY KEY constraint
'table1.table1_pkey' violated"); |
| 155370749 |
sql.update(_2=265069960,"sys","table1","table1_pkey",_34=nil);
|
| 100795 | sql.exportOperation("");
|
| 2078534997850 | user.s2_3();
|
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
52 tuples
Timer 2078538307.087 msec 52 rows
Hope this helps.
--
View this message in context: http://old.nabble.com/Add-primary-key-performance-tp30397515p30663027.html
Sent from the monetdb-users mailing list archive at Nabble.com.