Today's Smalltalk Daily looks at reusing column buffers with Oracle (version 9 and up) with VisualWorks. This is an upcoming feature of VisualWorks, scheduled for VW 7.7.1. If you're looking for a particular topic, you can find it with the Media Search application on our site.
The code used is below; To watch, click on the viewer:
"Connect to an Oracle database."
conn := OracleConnection new.
conn username: 'username';
password: 'password';
environment: 'ORACLEDB'.
conn connect.
sess := conn getSession.
"The default is false meaning not to reuse."
sess reuseColumnBuffers: false.
t1 := Time millisecondsToRun:[
" | conn sess ansStrm |"
100 timesRepeat: [
sess prepare: 'select * from sys.all_tables where TABLE_NAME=''DUAL'''.
sess execute.
ansStrm := sess answer.
res := ansStrm upToEnd.
].
].
Transcript cr; show: 'Time spent without reusing row buffers: ', t1 asFloat printString.
"Set to reuse the column buffers."
sess reuseColumnBuffers: true.
t2 := Time millisecondsToRun:[
" | conn sess ansStrm |"
100 timesRepeat: [
sess prepare: 'select * from sys.all_tables where TABLE_NAME=''DUAL'''.
sess execute.
ansStrm := sess answer.
res := ansStrm upToEnd.
].
].
Transcript cr; show: 'Time spent with reusing row buffers: ', t2 asFloat printString.
If you have trouble viewing that directly, you can click here to download the video directly
You can also watch it on YouTube:
Technorati Tags:
visualworks, oracle, database, reuse buffers