*** empty log message ***
[csql.git] / test / performance / wisc / odbcBench.c
blobee4617f1a88c4b855c0fb2b76fa5c7c0aec5d60d
2 #include <iostream>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <string.h>
6 #include <time.h>
7 #include <sql.h>
8 #include <sqlext.h>
9 #include "NanoTimer.h"
10 #define ITERATION 100
11 using namespace std;
13 NanoTimer timer;
14 long long int timevalues[30]={0};
15 void extract_error(
16 char *fn,
17 SQLHANDLE handle,
18 SQLSMALLINT type)
20 SQLINTEGER i = 0;
21 SQLINTEGER native;
22 SQLCHAR state[ 7 ];
23 SQLCHAR text[256];
24 SQLSMALLINT len;
25 SQLRETURN ret;
27 fprintf(stderr,
28 "\n"
29 "The driver reported the following diagnostics whilst running "
30 "%s\n\n",
31 fn);
35 ret = SQLGetDiagRec(type, handle, ++i, state, &native, text,
36 sizeof(text), &len );
37 if (SQL_SUCCEEDED(ret))
38 printf("%s:%ld:%ld:%s\n", state, i, native, text);
40 while( ret == SQL_SUCCESS );
43 inline void
44 check_error (SQLSMALLINT handleType, SQLHANDLE handle, int rc, int line)
46 if (rc)
48 cout << "Error " << rc << " at line: " << line << endl;
49 SQLCHAR state[10];
50 SQLINTEGER native;
51 SQLCHAR mesg[300];
52 int i=0;
53 while (SQLGetDiagRec (handleType, handle, i++, state, &native, mesg, 300,
54 NULL) == SQL_SUCCESS)
56 mesg[299] = '\0';
57 cout << "state: " << state << endl;
58 cout << "native: " << native << endl;
59 cout << "mesg: " << mesg << endl;
61 exit (1);
66 inline void checkrc (int rc, int line)
68 if (rc)
70 cout << "Error " << rc << " at line: " << line << endl;
71 exit (1);
75 void readWriteTrans (SQLHDBC hdbc)
77 int rc = SQLSetConnectAttr (hdbc, SQL_ATTR_ACCESS_MODE,
78 (SQLPOINTER) SQL_MODE_READ_WRITE, 0);
79 checkrc (rc, __LINE__);
80 rc = SQLEndTran (SQL_HANDLE_DBC, hdbc, SQL_COMMIT);
81 checkrc (rc, __LINE__);
84 void readOnlyTrans (SQLHDBC hdbc)
86 int rc = SQLSetConnectAttr (hdbc, SQL_ATTR_ACCESS_MODE,
87 (SQLPOINTER) SQL_MODE_READ_ONLY, 0);
88 checkrc (rc, __LINE__);
89 rc = SQLEndTran (SQL_HANDLE_DBC, hdbc, SQL_COMMIT);
90 checkrc (rc, __LINE__);
93 void createHashIndex(SQLHANDLE hstmt,bool flag)
95 int rc;
96 rc = SQLExecDirect(hstmt, (SQLCHAR*) "CREATE INDEX idx1 ON big1(unique1) HASH;", SQL_NTS );
97 checkrc (rc, __LINE__);
98 rc = SQLExecDirect(hstmt, (SQLCHAR*) "CREATE INDEX idx2 ON big2(unique1) HASH;", SQL_NTS );
99 checkrc (rc, __LINE__);
100 rc = SQLExecDirect(hstmt, (SQLCHAR*) "CREATE INDEX idx3 ON small(unique1) HASH", SQL_NTS );
101 checkrc (rc, __LINE__);
102 rc = SQLExecDirect(hstmt, (SQLCHAR*) "CREATE INDEX idx4 ON big1(stringu1) HASH", SQL_NTS );
103 checkrc (rc, __LINE__);
105 void createTreeIndex(SQLHANDLE hstmt,bool flag)
107 int rc;
108 rc = SQLExecDirect(hstmt, (SQLCHAR*) "CREATE INDEX idx5 ON big1(unique1) TREE;", SQL_NTS );
109 checkrc (rc, __LINE__);
110 rc = SQLExecDirect(hstmt, (SQLCHAR*) "CREATE INDEX idx6 ON big2(unique1) TREE;", SQL_NTS );
111 checkrc (rc, __LINE__);
112 rc = SQLExecDirect(hstmt, (SQLCHAR*) "CREATE INDEX idx7 ON small(unique1) TREE;", SQL_NTS );
113 checkrc (rc, __LINE__);
114 rc = SQLExecDirect(hstmt, (SQLCHAR*) "CREATE INDEX idx8 ON big1(stringu1) TREE;", SQL_NTS );
115 checkrc (rc, __LINE__);
118 void dropHashIndex(SQLHANDLE hstmt,bool flag)
120 int rc;
121 rc = SQLExecDirect(hstmt, (SQLCHAR*) "DROP INDEX idx1 ;", SQL_NTS );
122 checkrc (rc, __LINE__);
123 rc = SQLExecDirect(hstmt, (SQLCHAR*) "DROP INDEX idx2 ;", SQL_NTS );
124 checkrc (rc, __LINE__);
125 rc = SQLExecDirect(hstmt, (SQLCHAR*) "DROP INDEX idx3 ;", SQL_NTS );
126 checkrc (rc, __LINE__);
127 rc = SQLExecDirect(hstmt, (SQLCHAR*) "DROP INDEX idx4 ;", SQL_NTS );
128 checkrc (rc, __LINE__);
130 void dropTreeIndex(SQLHANDLE hstmt,bool flag)
132 int rc;
133 rc = SQLExecDirect(hstmt, (SQLCHAR*) "DROP INDEX idx5 ;", SQL_NTS );
134 checkrc (rc, __LINE__);
135 rc = SQLExecDirect(hstmt, (SQLCHAR*) "DROP INDEX idx6 ;", SQL_NTS );
136 checkrc (rc, __LINE__);
137 rc = SQLExecDirect(hstmt, (SQLCHAR*) "DROP INDEX idx7 ;", SQL_NTS );
138 checkrc (rc, __LINE__);
139 rc = SQLExecDirect(hstmt, (SQLCHAR*) "DROP INDEX idx8 ;", SQL_NTS );
140 checkrc (rc, __LINE__);
144 long long int onePerSel(SQLHANDLE henv, SQLHANDLE hdbc, SQLHANDLE hstmt)
146 int uni1;
147 int uni2;
148 char str1[200];
149 char str2[200];
150 int val[] = {1, 5, 10, 50, 100, 500, 1000, 5000 ,7500, 9900};;
151 int tempTermVar=0;
152 int tempTermVar2=0;
153 char tempval[124]="Value";
154 int rc;
155 readOnlyTrans (hdbc);
156 rc = SQLPrepare (hstmt, (unsigned char *) "SELECT unique1, unique2, stringu1 from big1 where unique1 between ? and ?;", SQL_NTS);
157 checkrc (rc, __LINE__);
158 rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &tempTermVar, 0, NULL);
159 checkrc (rc, __LINE__);
160 rc = SQLBindParameter (hstmt, 2, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &tempTermVar2, 0, NULL);
161 checkrc (rc, __LINE__);
163 rc = SQLBindCol (hstmt, 1, SQL_INTEGER, &uni1, 0, NULL);
164 checkrc (rc, __LINE__);
165 rc = SQLBindCol (hstmt, 2, SQL_INTEGER, &uni2, 0, NULL);
166 checkrc (rc, __LINE__);
167 rc = SQLBindCol (hstmt, 3, SQL_C_CHAR, str1, sizeof (str1), NULL);
168 checkrc (rc, __LINE__);
169 //rc = SQLBindCol (hstmt, 4, SQL_C_CHAR, str2, sizeof (str2), NULL);
170 //checkrc (rc, __LINE__);
172 int i, j, k;
173 int Count;
175 timer.reset ();
177 /* Run 1per Test */
178 for (i = 0; i < 10; i++)
180 Count=0;
181 strcpy(tempval,"Value");
182 tempTermVar = val[i] ;
183 tempTermVar2 = val[i]+99 ;
184 timer.start ();
185 rc = SQLExecute (hstmt);
186 checkrc (rc, __LINE__);
187 while(SQL_SUCCEEDED(rc = SQLFetch(hstmt)))
189 Count++;
191 // printf("Count=%d\n",Count);
192 rc = SQLCloseCursor (hstmt);
193 checkrc (rc, __LINE__);
194 rc = SQLTransact (henv, hdbc, SQL_COMMIT);
195 checkrc (rc, __LINE__);
196 timer.stop ();
198 readWriteTrans (hdbc);
199 //printf ("Read: 1 %lld\n", timer.avg ());
200 return timer.avg()/1000;
203 long long int runReadTest (SQLHANDLE henv, SQLHANDLE hdbc,SQLHANDLE hstmt,bool flag)
205 int uni1;
206 int uni2;
207 char str1[200];
208 char str2[200];
210 int val[] = {1, 5, 10, 50, 100, 500, 1000, 5000 ,7500, 9999};;
211 int tempTermVar=0;
212 char tempval[124]="Value";
213 int rc;
215 /* Set read-only transaction type */
216 readOnlyTrans (hdbc);
217 if(flag){
218 rc = SQLPrepare (hstmt, (unsigned char *) "SELECT unique1, unique2, stringu1, stringu2 from big1 where unique1=?;", SQL_NTS);
220 else {
221 rc = SQLPrepare (hstmt, (unsigned char *) "SELECT unique1, unique2, stringu1, stringu2 from big1 where stringu1=?;", SQL_NTS);
223 checkrc (rc, __LINE__);
224 long sz = 0;
225 if(flag){
226 rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &tempTermVar, 0, NULL);
227 checkrc (rc, __LINE__);
229 else{
230 rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_C_CHAR, 196, 0, tempval, 0, NULL);
231 checkrc (rc, __LINE__);
234 rc = SQLBindCol (hstmt, 1, SQL_INTEGER, &uni1, 0, NULL);
235 checkrc (rc, __LINE__);
236 rc = SQLBindCol (hstmt, 2, SQL_INTEGER, &uni2, 0, NULL);
237 checkrc (rc, __LINE__);
238 rc = SQLBindCol (hstmt, 3, SQL_C_CHAR, str1, sizeof (str1), NULL);
239 checkrc (rc, __LINE__);
240 rc = SQLBindCol (hstmt, 4, SQL_C_CHAR, str2, sizeof (str2), NULL);
241 checkrc (rc, __LINE__);
243 int i, j, k;
244 int Count;
246 timer.reset ();
248 /* Run 1per Test */
249 for (i = 0; i < 10; i++)
251 strcpy(tempval,"Value");
252 if(flag){
253 tempTermVar = val[i] ;}
254 else{
255 char buf[10];
256 sprintf(buf,"%d",val[i]);
257 strcat(tempval,buf);
259 timer.start ();
260 rc = SQLExecute (hstmt);
261 checkrc (rc, __LINE__);
262 rc = SQLFetch (hstmt);
263 checkrc (rc, __LINE__);
264 Count++;
265 rc = SQLCloseCursor (hstmt);
266 checkrc (rc, __LINE__);
267 rc = SQLTransact (henv, hdbc, SQL_COMMIT);
268 checkrc (rc, __LINE__);
269 timer.stop ();
271 //printf ("Read: 1 %lld\n", timer.avg ());
272 /* Set read-write transaction type */
273 readWriteTrans (hdbc);
274 return timer.avg()/1000;
278 //aggregate
279 long long int aggregate(SQLHANDLE henv, SQLHANDLE hdbc,SQLHANDLE hstmt,bool flag)
281 int summin;
282 int rc;
283 /* Set read-only transaction type */
284 readOnlyTrans (hdbc);
285 if(flag){
286 rc = SQLPrepare (hstmt, (unsigned char *) "SELECT MIN(unique1) from big1;", SQL_NTS);
288 else {
289 rc = SQLPrepare (hstmt, (unsigned char *) "SELECT SUM(unique1) from big1;", SQL_NTS);
291 checkrc (rc, __LINE__);
292 rc = SQLBindCol (hstmt, 1, SQL_INTEGER, &summin, 0, NULL);
293 checkrc (rc, __LINE__);
295 int i, j, k;
296 int Count;
298 timer.reset ();
299 for (i = 0; i < 10; i++)
301 timer.start ();
302 rc = SQLExecute (hstmt);
303 checkrc (rc, __LINE__);
304 rc = SQLFetch (hstmt);
305 checkrc (rc, __LINE__);
306 Count++;
307 // printf("value=%d",summin);
308 rc = SQLCloseCursor (hstmt);
309 checkrc (rc, __LINE__);
310 rc = SQLTransact (henv, hdbc, SQL_COMMIT);
311 checkrc (rc, __LINE__);
312 timer.stop ();
314 //printf ("Read: 1 %lld\n", timer.avg ());
315 /* Set read-write transaction type */
316 readWriteTrans (hdbc);
317 return timer.avg()/1000;
321 long long int dmlstatement(SQLHANDLE henv, SQLHANDLE hdbc,SQLHANDLE hstmt,int val)
323 int tempTermVar=10000,tempTermVar2=10000;
324 int rc;
325 /* Set read-only transaction type */
326 readOnlyTrans (hdbc);
327 if(val==1){
328 rc = SQLPrepare (hstmt, (unsigned char *) "insert into big1 values(?,?,0,2,0,10,50,688,1950,4950,9950,1,100,'MXXXXXXXXXXXXXXXXXXXXXXXXXGXXXXXXXXXXXXXXXXXXXXXXXXC','GXXXXXXXXXXXXXXXXXXXXXXXXXCXXXXXXXXXXXXXXXXXXXXXXXXA','OXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXO');", SQL_NTS);
330 else if(val==2){
331 rc = SQLPrepare (hstmt, (unsigned char *) "UPDATE big1 SET two=1 WHERE unique1=?;", SQL_NTS);
332 }else
334 rc = SQLPrepare (hstmt, (unsigned char *) "DELETE FROM big1 WHERE unique1=?;", SQL_NTS);
336 checkrc (rc, __LINE__);
338 int i, j, k;
339 int Count;
341 timer.reset ();
342 for (i = 0; i < 100; i++)
343 { tempTermVar+=i;
344 rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &tempTermVar, 0, NULL);
345 checkrc (rc, __LINE__);
346 if(val==1)
348 tempTermVar2+=i;
349 rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &tempTermVar2, 0, NULL);
350 checkrc (rc, __LINE__);
352 timer.start ();
353 rc = SQLExecute (hstmt);
354 checkrc (rc, __LINE__);
355 rc = SQLTransact (henv, hdbc, SQL_COMMIT);
356 checkrc (rc, __LINE__);
357 timer.stop ();
358 tempTermVar=10000;tempTermVar2=10000;
360 //printf ("Read: 1 %lld\n", timer.avg ());
361 /* Set read-write transaction type */
362 readWriteTrans (hdbc);
363 return timer.avg()/1000;
367 //Joining
368 long long int joining(SQLHANDLE henv, SQLHANDLE hdbc, SQLHANDLE hstmt,int flag)
370 int uni1;
371 int uni2,uni3,uni4,uni5;
372 char str1[200];
373 char str2[200];
375 int val[] = {1, 5, 10, 50, 100, 250, 500, 750, 900, 999};
376 int tempTermVar=0;
377 char tempval[124]="Value";
378 int rc;
380 /* Set read-only transaction type */
381 readOnlyTrans (hdbc);
382 if(flag==1){
383 rc = SQLPrepare (hstmt, (unsigned char *) "SELECT big1.unique1, big1.unique2, small.unique1, small.stringu1 FROM small,big1 WHERE big1.unique1=small.unique1 AND small.unique1=?;", SQL_NTS);
385 else {
386 rc = SQLPrepare (hstmt, (unsigned char *) "SELECT small.unique1, big1.unique1, big2.unique1, small.stringu1, big1.unique2, big2.unique2 FROM big1, big2, small WHERE small.unique1=big1.unique1 AND big1.unique1=big2.unique1 AND big1.unique1 = ?;", SQL_NTS);
388 checkrc (rc, __LINE__);
389 long sz = 0;
390 rc = SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &tempTermVar, 0, NULL);
391 checkrc (rc, __LINE__);
392 rc = SQLBindCol (hstmt, 1, SQL_INTEGER, &uni1, 0, NULL);
393 checkrc (rc, __LINE__);
394 rc = SQLBindCol (hstmt, 2, SQL_INTEGER, &uni2, 0, NULL);
395 checkrc (rc, __LINE__);
396 rc = SQLBindCol (hstmt, 2, SQL_INTEGER, &uni3, 0, NULL);
397 checkrc (rc, __LINE__);
398 rc = SQLBindCol (hstmt, 4, SQL_C_CHAR, str1, sizeof (str1), NULL);
399 checkrc (rc, __LINE__);
400 if(flag==2){
401 rc = SQLBindCol (hstmt, 5, SQL_INTEGER, &uni4, 0, NULL);
402 checkrc (rc, __LINE__);
403 rc = SQLBindCol (hstmt, 6, SQL_INTEGER, &uni5, 0, NULL);
404 checkrc (rc, __LINE__);
406 int i, j, k;
407 int Count;
409 timer.reset ();
411 /* Run 1per Test */
412 for (i = 0; i < 10; i++)
414 tempTermVar = val[i] ;
415 timer.start ();
416 rc = SQLExecute (hstmt);
417 checkrc (rc, __LINE__);
418 rc = SQLFetch(hstmt);
419 Count++;
420 // printf("%d,%d\n",uni1,uni3);
421 rc = SQLCloseCursor (hstmt);
422 checkrc (rc, __LINE__);
423 rc = SQLTransact (henv, hdbc, SQL_COMMIT);
424 checkrc (rc, __LINE__);
425 timer.stop ();
427 //printf ("Read: 1 %lld\n", timer.avg ());
428 /* Set read-write transaction type */
429 readWriteTrans (hdbc);
430 return timer.avg()/1000;
434 void printTime()
436 printf("Wisconsin Benchmark Report:\n");
437 printf("*******************************************************\n");
438 printf(" Statement \t NoIndex Hash\t Tree\n");
439 printf("*******************************************************\n");
440 printf(" SelectInt 1 \t %lld\t %lld \t %lld\n",timevalues[0],timevalues[1],timevalues[2]);
441 printf(" SelectStr 1 \t %lld\t %lld \t %lld\n",timevalues[3],timevalues[4],timevalues[5]);
442 printf(" 1Per Sel \t %lld\t %lld \t %lld\n\n",timevalues[6],timevalues[7],timevalues[8]);
443 printf(" Min All \t %lld\t %lld \t %lld\n",timevalues[9],timevalues[10],timevalues[11]);
444 printf(" Sum All \t %lld\t %lld \t %lld\n\n",timevalues[12],timevalues[13],timevalues[14]);
445 printf(" Insert 1 \t %lld\t %lld \t %lld\n",timevalues[15],timevalues[16],timevalues[17]);
446 printf(" Update 1 \t %lld\t %lld \t %lld\n",timevalues[18],timevalues[19],timevalues[20]);
447 printf(" Delete 1 \t %lld\t %lld \t %lld\n\n",timevalues[21],timevalues[22],timevalues[23]);
448 printf(" Join(10K*1K)1 \t %lld\t %lld \t %lld\n",timevalues[24],timevalues[25],timevalues[26]);
449 printf(" Join(10K*10K*1K)1 \t %lld\t %lld \t %lld\n",timevalues[27],timevalues[28],timevalues[29]);
450 printf("*******************************************************\n");
455 int main (int ac, char **av)
457 int rc;
458 SQLHENV henv;
459 SQLHDBC hdbc;
460 SQLHSTMT hstmt;
462 rc = SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
463 checkrc (rc, __LINE__);
464 SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);
466 rc = SQLAllocHandle (SQL_HANDLE_DBC, henv, &hdbc);
467 checkrc (rc, __LINE__);
468 rc = SQLConnect (hdbc,
469 (SQLCHAR *) "test", (SQLSMALLINT) strlen ("test"),
470 (SQLCHAR *) "root",
471 (SQLSMALLINT) strlen ("root"),
472 (SQLCHAR *) "manager",
473 (SQLSMALLINT) strlen (""));
475 if (SQL_SUCCEEDED(rc)) {
476 printf("Connected\n");
477 //printf("Returned connection string was:\n\t%s\n", outstr);
478 if (rc == SQL_SUCCESS_WITH_INFO) {
479 printf("Driver reported the following diagnostics\n");
480 extract_error("SQLDriverConnect", hdbc, SQL_HANDLE_DBC);
482 } else {
483 fprintf(stderr, "Failed to connect\n");
484 extract_error("SQLDriverConnect", hdbc, SQL_HANDLE_DBC);
487 //check_error (SQL_HANDLE_DBC, hdbc, rc, __LINE__);
488 checkrc (rc, __LINE__);
489 rc = SQLSetConnectOption (hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
490 checkrc (rc, __LINE__);
491 rc = SQLAllocHandle (SQL_HANDLE_STMT, hdbc, &hstmt);
492 checkrc (rc, __LINE__);
493 int ins=1,upd=2,del=3;
494 //Query 1
495 timevalues[0] = runReadTest (henv, hdbc, hstmt,true);
496 timevalues[3] = runReadTest (henv, hdbc, hstmt,false);
497 timevalues[6] = onePerSel(henv, hdbc, hstmt);
498 timevalues[9] = aggregate(henv, hdbc, hstmt,true);
499 timevalues[12] = aggregate(henv, hdbc, hstmt,false);
500 timevalues[15] = dmlstatement(henv, hdbc, hstmt,ins);
501 timevalues[18] = dmlstatement(henv, hdbc, hstmt,upd);
502 timevalues[21] = dmlstatement(henv, hdbc, hstmt,del);
503 timevalues[24] = joining(henv, hdbc, hstmt,1);
504 timevalues[27] = joining(henv, hdbc, hstmt,2);
505 printf("NON INDEX OVER\n");
507 //Hash
508 createHashIndex( hstmt,true);
509 timevalues[1] = runReadTest (henv, hdbc, hstmt,true);
510 timevalues[4] = runReadTest (henv, hdbc, hstmt,false);
511 timevalues[7] = onePerSel(henv, hdbc, hstmt);
512 timevalues[10] = aggregate(henv, hdbc, hstmt,true);
513 timevalues[13] = aggregate(henv, hdbc, hstmt,false);
514 timevalues[16] = dmlstatement(henv, hdbc, hstmt,ins);
515 timevalues[19] = dmlstatement(henv, hdbc, hstmt,upd);
516 timevalues[22] = dmlstatement(henv, hdbc, hstmt,del);
517 timevalues[25] = joining(henv, hdbc, hstmt,1);
518 timevalues[28] = joining(henv, hdbc, hstmt,2);
519 dropHashIndex(hstmt,true);
520 printf("HASH INDEX OVER\n");
521 //printTime();
523 //TREE
524 createTreeIndex(hstmt,true);
525 timevalues[2] = runReadTest (henv, hdbc, hstmt,true);
526 timevalues[5] = runReadTest (henv, hdbc, hstmt,false);
527 timevalues[8] = onePerSel(henv, hdbc, hstmt);
528 timevalues[11] = aggregate(henv, hdbc, hstmt,true);
529 timevalues[14] = aggregate(henv, hdbc, hstmt,false);
530 timevalues[17] = dmlstatement(henv, hdbc, hstmt,ins);
531 timevalues[20] = dmlstatement(henv, hdbc, hstmt,upd);
532 timevalues[23] = dmlstatement(henv, hdbc, hstmt,del);
533 timevalues[26] = joining(henv, hdbc,hstmt,1);
534 timevalues[29] = joining(henv, hdbc,hstmt,2);
535 dropTreeIndex(hstmt,true);
536 printf("TREE INDEX OVER\n");
538 printTime();
539 rc = SQLEndTran(SQL_HANDLE_DBC, hdbc, SQL_COMMIT );
540 checkrc (rc, __LINE__);
542 rc = SQLFreeHandle (SQL_HANDLE_STMT, hstmt);
543 checkrc (rc, __LINE__);
544 rc = SQLDisconnect (hdbc);
545 checkrc (rc, __LINE__);
546 rc = SQLFreeHandle (SQL_HANDLE_DBC, hdbc);
547 checkrc (rc, __LINE__);
548 rc = SQLFreeHandle (SQL_HANDLE_ENV, henv);
549 checkrc (rc, __LINE__);
550 exit (0);