trie index changes
[csql.git] / test / performance / throughput / treeIndexTest.java
blob673d8fa8fccc93886800cb3bd7ea87927f1d1c7c
2 import java.sql.*;
3 /**
5 * @author bijaya
6 */
8 public class treeIndexTest{
10 public static void main(String[] args) {
11 try
14 int noOfThreads=5;
15 int noOfRecords=10000;
16 Connection con = connect.getDBConn();
17 Statement cStmt = con.createStatement();
18 cStmt.execute("CREATE TABLE emp (f1 int, f2 char (20));");
19 cStmt.execute("create index ind on emp(f1) tree unique;");
20 connect[] conth= new connect[10];
21 System.out.println("Table Insert");
22 for(int i=0;i<noOfThreads;i++)
24 conth[i] = new connect(i,0,noOfRecords);
26 for(int i=0;i<noOfThreads;i++)
28 conth[i].th.join();
30 long totalTimeTaken=0;
31 for(int i=0;i<noOfThreads;i++)
33 totalTimeTaken = totalTimeTaken + conth[i].timeTaken;
35 System.out.println("Table Insert " + totalTimeTaken);
38 for(int i=0;i<noOfThreads;i++)
40 conth[i] = new connect(i,1,noOfRecords);
42 for(int i=0;i<noOfThreads;i++)
44 conth[i].th.join();
46 totalTimeTaken=0;
47 for(int i=0;i<noOfThreads;i++)
49 totalTimeTaken = totalTimeTaken + conth[i].timeTaken;
51 System.out.println("Table Select " + totalTimeTaken);
54 /*for(int i=0;i<noOfThreads;i++)
56 conth[i] = new connect(i,2,noOfRecords);
58 for(int i=0;i<noOfThreads;i++)
60 conth[i].th.join();
62 System.out.println("Table delete");
63 for(int i=0;i<noOfThreads;i++)
65 conth[i] = new connect(i,3,noOfRecords);
67 for(int i=0;i<noOfThreads;i++)
69 conth[i].th.join();
71 System.out.println("Drop Table ");
74 cStmt.execute("DROP TABLE emp ;");
75 con.close();
76 }catch(Exception e) {
77 System.out.println("Exception in Test: "+e);
78 e.printStackTrace();