Controlling cache of individual records
Is it possible to control individual records being cached in memory or staying
on disk? Or is that a table-wide setting only?
Thanks!
- Jeramie Hicks
[171 byte] By [
Jeramie] at [2007-11-9 18:52:07]

# 2 Re: Controlling cache of individual records
Well, we're developing a server that relies heavily on DB2. We're looking
to create a generalized "resource" table that includes BLOBs containing the
various multimedia objects (standard and propreitary). The server will be
able to figure out which ones are accessed frequently or not, so I was wondering
if it was possible to define individual records as either memory-cached or
disk-cached. We were concerned whether the entire table (which could be several
gigabytes) would have to be entirely cached in one location (either entirely
on disk or entirely in memory), or whether individual records could be controlled
seperately (either by us or by DB2).
Thank ye... Jeramie Hicks
# 3 Re: Controlling cache of individual records
Technically you could artifically cache at the table level by defining that
table with a different pagesize than all other tables and create a buffer
pool for that pagesize specifically. Then the most active rows (or all if
the pool was large enough) would remain in the buffers. Note you could define
multiple tables to that page size, sharing the bufferpool.
Except I believe LOBs, of any kind, are not buffered. Relying strictly on
the OS Caching mechanism. Which in my opinion should be turned off anyhow.
So I guess the real answer is No, it can't be done. I would think the I/O
activity constantly fetching the various BLOBs would be pretty ugly, so you
may have your work cut out for you making this app perform.
KlK, MCSE
"Jeramie Hicks" <JeramieHicks@hotmail.com> wrote:
>
>Well, we're developing a server that relies heavily on DB2. We're looking
>to create a generalized "resource" table that includes BLOBs containing
the
>various multimedia objects (standard and propreitary). The server will be
>able to figure out which ones are accessed frequently or not, so I was wondering
>if it was possible to define individual records as either memory-cached
or
>disk-cached. We were concerned whether the entire table (which could be
several
>gigabytes) would have to be entirely cached in one location (either entirely
>on disk or entirely in memory), or whether individual records could be controlled
>seperately (either by us or by DB2).
>
>Thank ye... Jeramie Hicks
# 4 Re: Controlling cache of individual records
Hi,
You're right about LOBs not being buffered by DB2's IO.
I don't think you've said what platform you're on... If the server is Windows, you
can use
db2set DB2NTNOCACHE=y
to disable OS cacheing completely and leave it to DB2. Yes, it applies to the whole
instance.
I expect you'd get the best results by using containers on different disks. Use a
caching management tool to enable file system caching on the disk(s) containing your
BLOB data, but disable it on the disk(s) with the fixed-length data.
I assume you've read the dev-archive article on "Where your data is and why it matters" in
the DB2 zone? Also check out the "extra info" links - there's one to an extensive
performance tuning guide.
--Greg
kevin knudson wrote:
> Technically you could artifically cache at the table level by defining that
> table with a different pagesize than all other tables and create a buffer
> pool for that pagesize specifically. Then the most active rows (or all if
> the pool was large enough) would remain in the buffers. Note you could define
> multiple tables to that page size, sharing the bufferpool.
>
> Except I believe LOBs, of any kind, are not buffered. Relying strictly on
> the OS Caching mechanism. Which in my opinion should be turned off anyhow.
>
> So I guess the real answer is No, it can't be done. I would think the I/O
> activity constantly fetching the various BLOBs would be pretty ugly, so you
> may have your work cut out for you making this app perform.
>
> KlK, MCSE
>
> "Jeramie Hicks" <JeramieHicks@hotmail.com> wrote:
> >
> >Well, we're developing a server that relies heavily on DB2. We're looking
> >to create a generalized "resource" table that includes BLOBs containing
> the
> >various multimedia objects (standard and propreitary). The server will be
> >able to figure out which ones are accessed frequently or not, so I was wondering
> >if it was possible to define individual records as either memory-cached
> or
> >disk-cached. We were concerned whether the entire table (which could be
> several
> >gigabytes) would have to be entirely cached in one location (either entirely
> >on disk or entirely in memory), or whether individual records could be controlled
> >seperately (either by us or by DB2).
> >
> >Thank ye... Jeramie Hicks