This repository was archived by the owner on Aug 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 259
Monetdb #183
Open
KimMoriarty
wants to merge
5
commits into
oltpbenchmark:master
Choose a base branch
from
KimMoriarty:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Monetdb #183
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cd7dc7b
Modification for monetdb
kunmin-db f395c69
Added benchmark config files
kunmin-db 9fe2bcc
Modifed tpch config file
kunmin-db 061e706
Minor bug fixed
kunmin-db b05ca3e
Isolated changes in benchmark configs to new files
kunmin-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,48 @@ | ||
| <?xml version="1.0"?> | ||
| <parameters> | ||
|
|
||
| <!-- Connection details --> | ||
| <dbtype>mysql</dbtype> | ||
| <driver>com.mysql.jdbc.Driver</driver> | ||
| <DBUrl>jdbc:mysql://server:3306/wikipedia</DBUrl> | ||
| <username>user</username> | ||
| <password>password</password> | ||
| <dbtype>monetdb</dbtype> | ||
| <driver>nl.cwi.monetdb.jdbc.MonetDriver</driver> | ||
| <DBUrl>jdbc:monetdb://localhost:50000/wiki</DBUrl> | ||
| <username></username> | ||
| <password></password> | ||
|
|
||
| <isolation>TRANSACTION_SERIALIZABLE</isolation> | ||
|
|
||
| <!-- Scale factor is the number of wikipages *1000 --> | ||
| <scalefactor>100</scalefactor> | ||
| <scalefactor>1</scalefactor> | ||
|
|
||
| <!-- Wikipedia Trace Options --> | ||
| <tracefile>config/traces/wikipedia-100k.trace</tracefile> | ||
| <traceOut>10</traceOut> | ||
| <base_ip>10.1.</base_ip> | ||
|
|
||
| <!-- The workload --> | ||
| <terminals>100</terminals> | ||
| <!-- The workload --> | ||
| <terminals>1</terminals> | ||
| <works> | ||
| <work> | ||
| <time>10</time> | ||
| <rate>1000</rate> | ||
| <weights>0.07,0.07,7.6725,91.2656,0.9219</weights> | ||
| <time>300</time> | ||
| <rate>unlimited</rate> | ||
| <weights>0.07,7.7425,91.2656,0.9219</weights> | ||
| </work> | ||
| </works> | ||
|
|
||
| <!-- Wikipedia Procedures Declaration --> | ||
| <transactiontypes> | ||
| <transactiontypes> | ||
| <transactiontype> | ||
| <name>AddWatchList</name> | ||
| </transactiontype> | ||
| <transactiontype> | ||
| <name>RemoveWatchList</name> | ||
| <name>AddWatchList</name> | ||
| </transactiontype> | ||
|
|
||
| <transactiontype> | ||
| <name>UpdatePage</name> | ||
| <name>RemoveWatchList</name> | ||
| </transactiontype> | ||
|
|
||
| <transactiontype> | ||
| <name>GetPageAnonymous</name> | ||
| <name>GetPageAnonymous</name> | ||
| </transactiontype> | ||
|
|
||
| <transactiontype> | ||
| <name>GetPageAuthenticated</name> | ||
| <name>GetPageAuthenticated</name> | ||
| </transactiontype> | ||
| </transactiontypes> | ||
| </parameters> | ||
| </parameters> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -421,6 +421,7 @@ private void loadRevision() throws SQLException { | |
| // Oracle handles quoted object identifiers differently, do not escape names | ||
| textSQL = SQLUtil.getInsertSQL(textTable, false); | ||
| } | ||
|
|
||
| PreparedStatement textInsert = this.conn.prepareStatement(textSQL); | ||
|
|
||
| // REVISION | ||
|
|
@@ -452,66 +453,63 @@ private void loadRevision() throws SQLException { | |
| int old_text_length = h_textLength.nextValue().intValue(); | ||
| assert(old_text_length > 0); | ||
| char old_text[] = TextGenerator.randomChars(rng(), old_text_length); | ||
|
|
||
| for (int i = 0; i < num_revised; i++) { | ||
| // Generate the User who's doing the revision and the Page revised | ||
| // Makes sure that we always update their counter | ||
| int user_id = h_users.nextInt(); | ||
| assert(user_id > 0 && user_id <= this.num_users) : "Invalid UserId '" + user_id + "'"; | ||
| this.user_revision_ctr[user_id-1]++; | ||
|
|
||
| // Generate what the new revision is going to be | ||
| if (i > 0) { | ||
| old_text = b.generateRevisionText(old_text); | ||
| old_text_length = old_text.length; | ||
| } | ||
|
|
||
| int rev_comment_len = Math.min(rev_comment_max, h_commentLength.nextValue().intValue()+1); // HACK | ||
| String rev_comment = TextGenerator.randomStr(rng(), rev_comment_len); | ||
| assert(rev_comment.length() <= rev_comment_max) : | ||
| String.format("[len=%d] ==> %s", rev_comment.length(), rev_comment); | ||
|
|
||
| // The REV_USER_TEXT field is usually the username, but we'll just | ||
| // put in gibberish for now | ||
| String user_text = TextGenerator.randomStr(rng(), h_nameLength.nextValue().intValue()+1); | ||
|
|
||
| // Insert the text | ||
| int col = 1; | ||
| textInsert.setInt(col++, rev_id); // old_id | ||
| textInsert.setString(col++, new String(old_text)); // old_text | ||
| textInsert.setString(col++, "utf-8"); // old_flags | ||
| textInsert.setInt(col++, page_id); // old_page | ||
| textInsert.addBatch(); | ||
|
|
||
| // Insert the revision | ||
| col = 1; | ||
| revisionInsert.setInt(col++, rev_id); // rev_id | ||
| revisionInsert.setInt(col++, page_id); // rev_page | ||
| revisionInsert.setInt(col++, rev_id); // rev_text_id | ||
| revisionInsert.setString(col++, rev_comment); // rev_comment | ||
| revisionInsert.setInt(col++, user_id); // rev_user | ||
| revisionInsert.setString(col++, user_text); // rev_user_text | ||
| revisionInsert.setString(col++, TimeUtil.getCurrentTimeString14()); // rev_timestamp | ||
| revisionInsert.setInt(col++, h_minorEdit.nextValue().intValue()); // rev_minor_edit | ||
| revisionInsert.setInt(col++, 0); // rev_deleted | ||
| revisionInsert.setInt(col++, 0); // rev_len | ||
| revisionInsert.setInt(col++, 0); // rev_parent_id | ||
| revisionInsert.addBatch(); | ||
|
|
||
| // Update Last Revision Stuff | ||
| this.page_last_rev_id[page_id-1] = rev_id; | ||
| this.page_last_rev_length[page_id-1] = old_text_length; | ||
| rev_id++; | ||
| if (this.getDatabaseType() == DatabaseType.ORACLE) { | ||
| PreparedStatement text_seq=this.conn.prepareStatement("select text_seq.nextval from dual"); | ||
| text_seq.execute(); | ||
| text_seq.close(); | ||
| PreparedStatement revision_seq=this.conn.prepareStatement("select revision_seq.nextval from dual"); | ||
| revision_seq.execute(); | ||
| revision_seq.close(); | ||
| } | ||
| batchSize++; | ||
| } // FOR (revision) | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What changed here? Is it just formatting? What parts are MonetDB specific?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We tried to remove the loop for |
||
| // Generate the User who's doing the revision and the Page revised | ||
| // Makes sure that we always update their counter | ||
| int user_id = h_users.nextInt(); | ||
| assert(user_id > 0 && user_id <= this.num_users) : "Invalid UserId '" + user_id + "'"; | ||
| this.user_revision_ctr[user_id-1]++; | ||
|
|
||
| // Generate what the new revision is going to be | ||
| old_text = b.generateRevisionText(old_text); | ||
| old_text_length = old_text.length; | ||
|
|
||
| int rev_comment_len = Math.min(rev_comment_max, h_commentLength.nextValue().intValue()+1); // HACK | ||
| String rev_comment = TextGenerator.randomStr(rng(), rev_comment_len); | ||
| assert(rev_comment.length() <= rev_comment_max) : | ||
| String.format("[len=%d] ==> %s", rev_comment.length(), rev_comment); | ||
|
|
||
| // The REV_USER_TEXT field is usually the username, but we'll just | ||
| // put in gibberish for now | ||
| String user_text = TextGenerator.randomStr(rng(), h_nameLength.nextValue().intValue()+1); | ||
|
|
||
| // Insert the text | ||
| int col = 1; | ||
| textInsert.setInt(col++, rev_id); // old_id | ||
| textInsert.setString(col++, new String(old_text)); // old_text | ||
| textInsert.setString(col++, "utf-8"); // old_flags | ||
| textInsert.setInt(col++, page_id); // old_page | ||
| textInsert.addBatch(); | ||
|
|
||
| // Insert the revision | ||
| col = 1; | ||
| revisionInsert.setInt(col++, rev_id); // rev_id | ||
| revisionInsert.setInt(col++, page_id); // rev_page | ||
| revisionInsert.setInt(col++, rev_id); // rev_text_id | ||
| revisionInsert.setString(col++, rev_comment); // rev_comment | ||
| revisionInsert.setInt(col++, user_id); // rev_user | ||
| revisionInsert.setString(col++, user_text); // rev_user_text | ||
| revisionInsert.setString(col++, TimeUtil.getCurrentTimeString14()); // rev_timestamp | ||
| revisionInsert.setInt(col++, h_minorEdit.nextValue().intValue()); // rev_minor_edit | ||
| revisionInsert.setInt(col++, 0); // rev_deleted | ||
| revisionInsert.setInt(col++, 0); // rev_len | ||
| revisionInsert.setInt(col++, 0); // rev_parent_id | ||
| revisionInsert.addBatch(); | ||
|
|
||
| // Update Last Revision Stuff | ||
| this.page_last_rev_id[page_id-1] = rev_id; | ||
| this.page_last_rev_length[page_id-1] = old_text_length; | ||
| rev_id++; | ||
| if (this.getDatabaseType() == DatabaseType.ORACLE) { | ||
| PreparedStatement text_seq=this.conn.prepareStatement("select text_seq.nextval from dual"); | ||
| text_seq.execute(); | ||
| text_seq.close(); | ||
| PreparedStatement revision_seq=this.conn.prepareStatement("select revision_seq.nextval from dual"); | ||
| revision_seq.execute(); | ||
| revision_seq.close(); | ||
| } | ||
| batchSize++; | ||
|
|
||
| if (batchSize > WikipediaConstants.BATCH_SIZE) { | ||
| textInsert.executeBatch(); | ||
| revisionInsert.executeBatch(); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not change the default sample config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create new config xml files named
tpcc_config_monetdb,tpch_config_monetdb,wikipedia_config_monetdb.