Query that table that match the foreign in the

Query and nodes generation

GraphJ uses a module called MySqlConnector which requires a DBConnection in order to establish a
connection and execute queries. The queries are executed using java.sql.Statement, the reason behind
using it instead of Hibernate 5 is
because HQL Queries suffers from performance degradation because it should
convert HQL to SQL 4, although the performance degradation is trivial, it
becomes more tangible when executing queries repeatedly. However, even with SQL
the performance degrades if the database has massive records. To overcome this
issue, the queries retrieve limited results, the limitation is read from an
environment variable with key QUERY LIMIT.
Inside MySqlConnector there are 3
main queries:

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

•    SELECT * FROM table

table is the table under processing.

We select all the rows from that table, in
order to create a node for each row. After the query is executed, all the
attributes are inserted into the node being created. We are able to map these
attributes because we know each column in each table with the help of SchemaInspector, each column name is the
key. Attributes with value of null are
ignored.

•   
SELECT
* FROM r table WHERE f k=o pk r table is the
foreign key table. f k is the foreign
key in r table.

o pk is the primary key in the table that has a relationship with r table.

We select all the rows from that table
that match the foreign in the original table.

• SELECT * FROM j
table INNER JOIN r table on r pk=r fk WHERE o fk = o pk j table is the
association table r table is the
foreign key table.

r pk is the primary key in original
table under processing. r fk is the
foreign key in r table.

o fk is the foreign key reference to original table under
processing. o pk is the primary key
in the table that has a relationship with r
table.

We select all the rows from that table
that match the foreign in the original table.

Queries are generated based on the schema selected and the
relationships between the tables.

G. Graph generation

As the nodes with their relationships
are created, the last step is to flush these nodes into the Neo4J database.
GraphJ will try to connect to a already instantiated Neo4J database, it will
read the database path from an environment variable with key NEO4J DB. This database’s host should be
stopped in order to establish a connection, as it can not establish two
connections at the same time.

                        IV.           EXPERIMENTAL EVALUATION

In this section experimental evaluation
details, goals and results of GraphJ are presented.

A. Goals

The goal was to evaluate the performance
of GraphJ. Hence, and to cover all the possible cases, we ran the tool on two
different databases with different run configurations. At the end, we compared
the total execution time of each one of the run configurations.

B. Subject Databases

For the
evaluation we used MySQL sample databases 32, because these database are well
known and widely used for testing MySQL queries. We chose three of these
databases (see table II):

•   
World X 48: Provided by
Oracle 29, it has a set of tables containing information on the countries and
cities of the world.

•   
Sakila 37: Provided by
Oracle 29, it is designed to represent a DVD rental store. This database
borrows film and actor names from the Dell sample database 11.

•   
Employees 14: Originally
developed by Patrick Crews and Giuseppe Maxia and provides a large set of data
that consists of 4 million records.

C. Configuration

We ran GraphJ
on 64-bit Linux machine with Intel Core i5-4200M and 8 GBs of memory. The MySQL
and Neo4J databases were located on localhost
on port 3306 and 7474. The performance can be affected by the nature of the
database and the query limitation, for that, we tried to simulate real-life
cases.

x

Hi!
I'm Owen!

Would you like to get a custom essay? How about receiving a customized one?

Check it out