Perf09
Perf09
Author:
Jeffrey R. Parsons, Raima Sr. Engineer
Date:
2012

Description

EXAMPLE - Perf09

This simple performance example creates 50,000 rows in a simple table in an on-disk database. It then spawns three threads. The first one updates rows in the table inside transactions with 1000 updates per transaction. The second thread attempts to read all the records to sum their contents. The third thread just periodically reports the results from the other two threads. The reading thread uses standard locks. This can be compared against the performance in Perf10 where the reading thread uses Read-Only Transactions.

Database

The DDL (Database Definition Language) specification for the database used in this example is located in the file perf09_db.ddl.

/*
* Raima Database Manager
*
* Copyright (c) 2012 Raima Inc., All rights reserved.
*
* EXAMPLE - perf09
*
* This is the DDL (Database Definition Language) for a simple Bill of
* Materials database. This version uses relation style idexes for
* relationships instead of sets.
*/
database perf09_db {
data file "perf09_db.d01" contains simple;
key file "perf09_db.k01" contains id;
record simple {
unique key int32_t id;
int32_t int_col;
}
}

The schema was compiled using the RDM ddlp utility with the -c option to generate an embedded database dictionary (used by the RDM d_open_ptr API).

ddlp -c -d perf09_db_db.ddl

The database dictionary information is embedded inside the application so an external DBD file stored on the file system is not required.

Functions Used

The following RDM functions are illustrated:

They are fully documented in http://docs.raima.com/rdm/.