Friday, May 23, 2008

Clob read speeds over jdbc

Thought I'd pass on some findings on clob read speed over jdbc.

In sqldeveloper , when you select #clob# from #table# the tool shows the first ~80 chars of the clob. I spent part of the last 2 days timing the fastest way to read clobs from the db. I mostly work on remote databases so I notice when network latency start getting high. In looking at java.sql.Clob there's a few way to get the text. I figured I'd test them and see if one was quicker than the other. I wrote a loop that walks all the tables which have clobs in the flow_xxx schema and timed 2 of then methods .getSubString and .getCharacterStream.read().

Here's the crux of my test:

// method one
int read = 80; // only need the first 80 to show
start = System.currentTimeMillis();
s = lob.getSubString(1, read);
long s1 = System.currentTimeMillis() - start;

// method two
start = System.currentTimeMillis();
char[] cbuf = new char[read];
lob.getCharacterStream().read(cbuf);
long s2 = System.currentTimeMillis() - start;



Outcome:

Total Rows Processed : 44850

Lobs ranged in size from null to 17k with the average working out to 114

Not surprisingly, when the LAN speeds were averaged out it was 0 and 0

However, over the slower connection .getSubString's average was 102ms and the read was 197ms.

Thursday, April 17, 2008

Who needs to store a password.

In sqldeveloper 1.5, if you don't want to have the option of saving the password for a connection try this:


Edit the sqldeveloper/bin/sqldeveloper.conf and add this:


AddVMOption -Dsqldev.savepasswd=false


Adding this will remove the checkbox to have the ability to save the password. I added this a while back and forgot until a recent post on the forums reminded me. A customer needed to for some complicity they had to meet.



Wednesday, April 16, 2008

Sorta off topic

This is only Oracle in that it's at HQ in the lobby of the 500 building. I've been loading my pictures to flickr and found this one that I had forgotten about.


Which tnsnames?

It seems to come up often that some people are unsure where the list of connections get picked up from. So, if your not sure which tnsnames file sqldev is using try this:

1) Open any worksheet

Sqldev just needs someplace to process the next command and doesn't actually use the connection for anything.

2) Enter : setloglevel oracle.dbtools.raptor.utils INFO

This sets the java logging level on for this package so you can avoid putting the entire tool into debug and being inundated withe log messages. setloglevel is something I put in to help debugging using the same method I had blogged on before.

3) open the new connection dialog

The tnsnames are read everytime the dialog opens. This is handy for testing changes to the tns files.

4) check the log

You should end up with something like this. The log will show where it's checking for the tnsnames.

Thursday, January 10, 2008

not it..

I was wondering if I would get out of this since I only blog about once every couple months.


Here goes 8 things.


1. First pay back to Carl for tagging me... My son beat Carl at Burnout ( my son was 6 at the time )

2. Made one of these a couple weeks ago with my son.

3. I've jumped out of planes and helicopters
4. I'm a ham , N1JLX. My first post to the internet shows that.

5. I ride a Honda Valkyrie.

6. I drive a mini cooper

7. Served as president of our water company for 1.5 years.

8. Currently playing warhawk So if you see klrice running around that's me.

Now to spread the fun to the sqldev team and tag Barry , Sue and Vadim .