Search notes:

SQL*Plus: SET ARRAYSIZE

The value of arraysize specifies the number or records that SQL*Plus fetches from the database in select statements.
The maximum value for arraysize is 5000.

Trying to measure the effect of setting ARRAYSIZE

set termout off
 
set pagesize               0
set linesize           32000
set trimspool             on
set flush                off
set tab                  off
 
 
drop   table tq84_export_performance_test;
create table tq84_export_performance_test (one_kb varchar(1024));
 
 
 
insert into tq84_export_performance_test
select
   lpad(level, 1024, '*')
from
   dual connect by level <= 10000;
commit;
 
------------------------------------
 
timing start "export 1 with default array size"
spool tq84_export_performance_test.out
select * from tq84_export_performance_test;
set termout on
timing stop
 
-- Repeat
 
set termout off
timing start "export 2 with default array size"
spool tq84_export_performance_test.out
select * from tq84_export_performance_test;
set termout on
timing stop
 
------------------------------------
 
set termout off
set arraysize           5000
 
timing start "export 1 with modified array size"
spool tq84_export_performance_test.out
select * from tq84_export_performance_test;
set termout on
timing stop
 
-- Repeat
 
set termout off
timing start "export 2 with modified array size"
spool tq84_export_performance_test.out
select * from tq84_export_performance_test;
set termout on
timing stop
 
------------------------------------
 
exit

Setting ARRAYSIZE to 1

Setting the ARRAYSIZE will fetch the first row and the next row in batches of two rows.
As explained by MOS Note 1265916.1, this is because SQL*Plus uses OCI which has a default prefetch value of 1.
Thus, the first fetch call returns 1 row becaue of this prefetch value. The next fetch calls will return 1 row for arraysize=1 and an additional row which is prefetched.
See also Bug 9103343.

See also

The default value of arraysize is changed to 100 when using SQL*Plus's command line option -fast.
SQL*Plus' set commands such as set rowprefetch
The value of arraysize also specifies the batch size for the copy command.
The stat name SQL*Net roundtrips to/from client.
SQL*Plus

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1741086642, '18.118.7.190', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL-Plus/set/arraysize(129): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78