If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > To define the table in DB2 cache or memory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-09-07, 06:26
yacov yacov is offline
Registered User
 
Join Date: Nov 2007
Posts: 4
To define the table in DB2 cache or memory

Hi,

My question is DBA oriented

I have a small table ~ 500 rows, each row 100 bytes.

All the accesses to this table in on-line operations are for read and not for update or insert.

But we have really many accesses to this table, about million every day.

Is it possible for DBA to define the table in DB2 cache or memory, in order to cause selects not going to the disk, but to go to the memory?

Thanks

Jack
Reply With Quote
  #2 (permalink)  
Old 11-09-07, 07:48
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Yes.

1) create a bufferpool that is big enough.
2) create a tablespace that uses this bufferpool
3) create you table in the new tablespace.
4) do not create any other tables in the tablespace
5) do not create any other tablespaces that use this bufferpool

Andy
Reply With Quote
  #3 (permalink)  
Old 11-09-07, 12:10
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
6) Create all necessary indexes on this table to ensure index-only access in most/all cases
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #4 (permalink)  
Old 11-09-07, 12:21
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Quote:
Originally Posted by stolze
6) Create all necessary indexes on this table to ensure index-only access in most/all cases
The table is very small and would only take up a few pages (depending on the pagesize). Creating an index would not guarantee their getting used because the table is so small. I have several table like this that have a PK and its index defined but in about every access plan I generate on SQL that uses these tables, the optimizer does a table scan even though the joins are on the PK.

Table scans are not bad for small tables.

Andy
Reply With Quote
  #5 (permalink)  
Old 11-09-07, 13:09
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
You are correct, Andy. The table has only about 15 pages...
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #6 (permalink)  
Old 11-12-07, 12:04
yacov yacov is offline
Registered User
 
Join Date: Nov 2007
Posts: 4
Thanks, I will talk with our DBA.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On