Alice scan mode values
You enable alice (adaptive linear index cleaning) mode
by setting the alice
option to any value between 1
and 12
(finest
initial granularity). For small- to medium-sized systems with few
or no indexes above 1 gigabyte, set the alice
option
to 6
or 7
. For systems with large
indexes, set alice to a higher mode.
When you set alice mode, the higher the mode, the more memory is used per index partition. However, the memory used is not a huge amount. The advantage is less I/O, as shown in the following table.
Alice Mode Setting | Memory or Block I/O |
---|---|
0 | Turns off alice scanning. |
1 | Uses exactly 8 bytes of memory (no adjusting). |
2 | Uses exactly 16 bytes of memory (no adjusting). |
3 | Each block of pages will need 512 I/O operations for cleaning. |
4 | Each block of pages will need 256 I/O operations for cleaning. |
5 | Each block of pages will need 128 I/O operations for cleaning. |
6 (default) | Each block of pages will need 64 I/O operations for cleaning. |
7 | Each block of pages will need 32 I/O operations for cleaning. |
8 | Each block of pages will need 16 I/O operations for cleaning. |
9 | Each block of pages will need 8 I/O operations for cleaning. |
10 | Each block of pages will need 4 I/O operations for cleaning. |
11 | Each block of pages will need 2 I/O operations for cleaning. |
12 | Each block of pages will need 1 I/O operations for cleaning. |
When you
set the alice mode, you need to consider memory usage versus I/O.
The lower the alice mode setting, the less memory the index will use.
The higher the alice mode setting, the more memory the index will
use. 12
is the highest mode value, because it is
a direct mapping of a single bit of memory to each instance of I/O.
Suppose you have an online page size of 2 KB and the default B-Tree
Scanner I/O size of 256 pages. If you set the alice mode to 6
,
each byte of memory can represent 131,072 index pages (256 MB). If
you set the mode to 10
, each byte of memory can represent
8,192 index pages (16 MB). Thus, changing the mode setting from 6
to 10
requests
16 times the memory, but requires 16 times less I/O.
If you have an index partition that uses 1 GB, then an alice mode
setting of 6
would take 4 bytes of memory, while
an alice mode setting of 10
would consume 64 bytes
of memory, as shown in this formula:
( {mode block size} io per bit * 8 bits per byte * 256 page per io )
Setting the alice mode to a value between 3 and 12 sets the initial amount of memory that is used for index cleaning. Subsequently, the B-tree scanners automatically adjust the mode based on the efficiency of past cleaning operations.
For example, if after five scans (by default), the I/O efficiency
is below 75 percent, the server automatically adjusts to the next
alice mode if you set the mode to a value above 2
.
For example, if an index is currently operating in alice mode 6
,
a B-tree scanner has cleaned the index at least 5 times, and the I/O
efficiency is below 75 percent, the server automatically adjusts to
mode 7
, the next higher mode. This doubles the memory
required, but reduces the I/O by a factor of 2.
The server will re-evaluate the index after five more scans to
determine the I/O efficiency again, and will continue to do this until
mode 12
. The server stops making adjustments at mode 12
.
6
:BTSCANNER num=2,threshold=10000,alice=6,compression=default