How SQL Index Affects Query Speed Performance

Ok, so maybe I’m done with the Database Management course, but that doesn’t mean that I’m done playing around with the database. This is just some easy to follow guide how to see the difference that an index made in a real database system using MySQL.

To see the significant time difference of a query with and without index, we will need to generate a significant amount of records and you know I’m not talking about a hundred or two hundred records here, I’m talking about at least one hundred thousand (100,000) records to one million (1,000,000) records.

The first question that probably come to your mind is ‘How can I create such huge amount of data?’. The answer is you don’t, let an application do that for you, and its name is Benerator. Anyway, let’s see the steps I did for this query performance test.

Continue reading “How SQL Index Affects Query Speed Performance”

How to Find Candidate Key(s)

As my final exam on Database Management Course closely approaching, I think I’m a bit forced (in a good way) to write some notes on the topics I’ve learned so far. This time it’s the notes on how to find candidate key of a given relation.

Lately after I started post my database notes on conflict and view serializability, and BCNF and 3NF check, I see increased visitors traffic to my blog. Some visitors actually visited my blog to find how to find candidate keys of a relation. I just have the time now to write this post, hopefully it’s not really too late.

Enough for the introduction, get your pencil and paper, let’s find that candidate keys!

Continue reading “How to Find Candidate Key(s)”

Getting Started using Apache OpenJPA

Few weeks ago we were required to learn an Object Relational Mapping (ORM) concept in our Introduction to Database Management System course. The ORM our professor wanted us to use is Apache OpenJPA. Not really sure what was the reason he chose Apache OpenJPA over JBoss Hibernate that is more commonly used in the industry.

Although both Hibernate and OpenJPA are JPA compliant, which means that they follow the JPA standards that were set by Java, tutorials and discussion of OpenJPA is a lot fewer than of Hibernate. This means that whenever we encounter trouble with OpenJPA, the answer is not always there.

What makes it even a bit worse is that even getting started with OpenJPA is not that easy. So just in case any of you have problem with it. This is my notes and tutorial of how to kickstart using OpenJPA with Eclipse.

Continue reading “Getting Started using Apache OpenJPA”

How to check for View Serializable and Conflict Serializable

This is a note for myself about how to check whether a schedule is view serializable, conflict serializable, or not.

There is various resources in the internet about how to do this, but the examples are a bit scattered, so in this post I just want to make a neat note on how to do it properly with several examples that can cover many possibilities as well.

Let’s get started! Continue reading “How to check for View Serializable and Conflict Serializable”