> I started this thread, and its evolution has lead me to
> believe that in fact I may not understand the implementation
> of the BLOCKFACTOR attribute. The following is from the 4.5
> Studio help:
>
> BLOCKFACTOR
> Optional. Specifies the maximum number of rows to fetch at a
> time from the server. The range is 1 (default) to 100. This
> parameter applies to ORACLE native database drivers and to
> ODBC drivers. Certain ODBC drivers may dynamically reduce
> the block factor at runtime.
>
> My understanding of this is that it determines the number of
> rows to fetch, regardless of size. Am I wrong? Also, are you
> able to answer my other question about if or not the MAXROWS
> would take precedence and if a stored procedure was used, what
> effect BLOCKFACTOR and MAXROWS have if the SP itself was
> limiting rows.

The BLOCKFACTOR and MAXROWS attributes are completely unrelated. Neither
will affect the other.

BLOCKFACTOR is used to control how many rows are transferred from the
database to the database client at one time. Let's say you execute a query,
and it returns one hundred rows. By default, the value for BLOCKFACTOR is 1,
and the database (DB) will have a conversation with the database client (CL)
like this:

CL: Here's my SQL query. Get to work!
...
DB: I've got your recordset right here.
CL. OK. Give me the first record.
DB. Here it is. Got it?
CL. Yes. Give me the second record.
... and so on up to the hundredth record, at which point CF will be able to
use the recordset in a CFOUTPUT or whatever.

Increasing the BLOCKFACTOR will allow the database to return more than one
record at a time to the client, which generally improves performance. The
total number of records that can be transferred at once is limited by the
available buffer size, which is 32Kb. So, to figure the appropriate
BLOCKFACTOR, you find the maximum length of a single row from your
recordset, then divide that into 32Kb. The use of BLOCKFACTOR doesn't affect
how many records are returned from the database, it only affects how they'll
be passed from the database to CF.

MAXROWS, on the other hand, determines how many records CF will accept from
the database; if you only want to show ten records, you'd set MAXROWS to 10.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to