Search

Top 60 Oracle Blogs

Recent comments

array processing

SQL Plus … the sweet spot

Need to get a bunch from rows out of the database? Most people are aware of the ARRAYSIZE parameter to improve the fetch performance back to the client, but many people are not aware of the newer ROWPREFETCH parameter.

Let’s take a look at each to see how quickly we can drag data back to our SQL Plus client. I’ll start with table called TX which is approximately 1500MB in size, and has just over 10millions.

First let’s look at the benefits you get from ramping up ARRAYSIZE. I’ll start with the default size of 15, and quickly you’ll see why that is not a good starting point if you are fetching lots of rows. (Important emphasis on the “if” there)

More chances to bulk process

I’m sure most of us have read or heard at a conference the benefits of array fetching and array binding when it comes to passing data back and forth to the database. And we’ve all seen the numerous demo scripts in PL/SQL along the lines of:


FORALL i in 1 .. n 
   INSERT ...

As such, there is a misconception out there that you are only going to be able to use bulk binding for basic DML operations. So I thought I’d share this example that came in via AskTOM recently. We got asked if there was any means of improving the performance of this row-by-row operation where the DML was a complex Text index search, with the additional complication that on a row by row basis, the DML may fail but that this was an anticipated outcome that needed to be handled and moved past. The scenario presented was as follows: