summaryrefslogtreecommitdiff
path: root/src/docs/tune-cursor-persist.dox
blob: 183a877434efb1b1475150fb2bc919e312b258cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*! @page tune_cursor_persist Cursor persistence

Opening a new cursor is a relatively expensive operation in WiredTiger
(especially in table objects and Log-Structured Merge Trees (LSM) trees,
where a logical cursor may require multiple, underlying object cursors),
and caching cursors can improve performance. On the other hand, cursors
hold positions in objects, and therefore long-lived cursor positions can
decrease performance by blocking page eviction or looking like a
long-lived transaction.

Best practices are to cache cursors, but use the WT_CURSOR::reset method
to discard the cursor's position in the object when the position is no
longer needed.  Additionally, use the WT_CURSOR::insert method instead
of the WT_CURSOR::update method when there's no need to hold a position
in the object, because the WT_CURSOR::insert method never holds a cursor
position and there's no need to call WT_CURSOR::reset.

 */