Thursday, April 23, 2009

Making my Future

As I am a Learner a goal that I achieved lately is approving my Google Summer of Code project DERBY test and fix of Apache Software Foundation. So I am improving my coding knowledge on databases and its functionality. Try my best to complete it in success.

Thursday, April 2, 2009

Apache Derby- fixing bugs

For fixing bugs I first choice DERBY-3892 because it has become a major problem for the Derby development and it’s about a delay when because of the query hangs, so I did a analysis on it and here is the report I made out(this is a copy of what I send to mailing list),
Rows Insertion time(s) Querying time(s)
100 2.281 2.346
1000 3.31 3.388
1500 4.497 4.575
2000 7.717 7.807
5000 16.064 16.143
10000 23.711 23.797
20000 37.76 37.926
50000 91.748 92.086
100000 185.492 185.98

I check the two insertion separately (Messaged User,Values )

When only data inserted to Messaged_user(insert to values table removed from
the code) table only it took 80.926s to insertion and 80.992s for querying.

When only data inserted to Values(insert to Messaged_User table removed from
the code) table only it took 77.054s to insertion and 77.16s for querying.

sum of the two in separate insertions=157.98s
sum of the two in separate querying=157.98s

Thats 30s different from what i got when the two insertions are in same
coding.
I try another time with two insertion at the same time. Amazingly i got
141.721s for insertion and 142.21s for querying. Try for another gave
161.523s for insertion and 162.014s for querying.

So i decided that bug must be on the "insertion"
Next i include the Statement class for execution inside the loop
Insted of,
PreparedStatement ps = con.prepareStatement
("INSERT INTO Messaged_Users VALUES (?, ?, DEFAULT,
DEFAULT)");
for (i=0; i<100000; i++) {
ps.setString(1, ""+i);
ps.setString(2, "User" + i);
ps.executeUpdate();
}
I used,
Statement stmt=con.createStatement();
for (i=0; i<100000; i++) {
stmt.executeUpdate("INSERT INTO Users VALUES ('"+i+"',
'Eranda')");
}
As a test, But I waited 15s for over the insertion and querying and stop
the process.
For further information about DERBY-3892
visit-https://issues.apache.org/jira/browse/DERBY-3892

My Attitude on Open Source:

Sri Lanka is a 3rd world country that is suffering from poverty. So the people cannot spend much money on software for their applications. As a solution we can use open source software. As a programmer contribution to a world class software design is a dream for me. Now I have a chance for making my dream a truth with the Open Source. Because in Open Source software we can get source code out of it and make modification on it so that much more reliable. It make the product a good one as because more experts on dfferent areas contributing their knowledge on it. Also a student like me can read the source code and learn how the things inside of a software works.

All that things make my first choice "Open Source" software rather than going for pirate copy of software. In my machine i use Ubuntu for all the programming works, Apache tomcat 6.016, Glassfish, and newly i introduce my machine Apache Derby. Last year I use Red Hat and Fedora for "C-compiling". So one of my future ambition is to work on a such project.