> > I don't think you'd always want to simply set BLOCKFACTOR to
> > 100. If you set the BLOCKFACTOR too large, the database driver
> > will lower it - and I'm not sure exactly how it figures out
> > what to lower it to. It might simply lower it back to the
> > default value of 1, which won't serve you well.
>
> I wouldn't think it would lower it to 1.

That's because you're using common sense. Cut that out!

Unfortunately, as you're well aware, things don't always work out optimally,
in the world of software or anywhere else. The fact is, I don't know what
happens if you specify a value that would work out to being too large for
the buffer. However, if Allaire makes such a point out of recommending that
you figure out the appropriate rowcount, that indicates to me that it's
probably worth our while to do this.

> > Allaire recommends that you divide your maximum record
> > length into 32Kb; I suspect they recommend this because you
> > might not get optimal performance otherwise. I could be
> > wrong about this, though. I don't know enough about how
> > things work at that relatively low level to be sure one
> > way or the other.
>
> OK, how do you figure out the max record length? A byte for every
> character in every field in the record? Or only the fields that are
> actually included in the query?
>
> So, if all the fields have 1024 characters max, it would be 32 / 1
> for a blockfactor of 32?

You're interested in the maximum length of a single row returned by your
query. So, let's say you have a table with this schema:

Item_ID: int identity
Item_Name: varchar(20)
Item_Description: varchar(8000)

If you wanted to select all fields, you'd have a maximum row size of 8024,
since the int field is 4 bytes. Divided into 32,768 bytes, that gives you
4.08 rows as your BLOCKFACTOR value. On the other hand, if you just selected
Item_ID and Item_Name, 24 goes into 32,768 bytes over 100 times, so we'd
specify the maximum allowed BLOCKFACTOR value, 100.

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