user manual

232
Chapter 13
Figure 13-1
Caching at the Type node to store newly derived fields
To Enable a Cache
E On the s tream canvas, right-clic k the node and click Cache on the menu.
E On the caching submenu, click Enable.
E You can turn the cache off by right-clicking the node and clicking Disable on the caching subm en u.
Caching Nodes in a Database
For streams run in a database, data can be cached midstream to a tempora ry table in the database
rather than the le system. When c ombined with SQL optimization, this may result in signicant
gains in performance. For exa mple, the output from a stre am that merges multiple tables t o crea te
a data mining view may b e cached and reuse d as neede d. By automatically gener ating SQL for
all downstream nodes, performance can be further improved.
When using database caching with s trings longer than 255 ch aracters, either ensure that there
is a Type node upstream from the caching node and that the eld values are read, or set the
string length by means o f the default_sql_string_length parameter in the options.cfg le . Doing
so ens ures that the corresponding column in the t emporary table is set to the correct width to
accommodate the strings.
To take advantage of database caching, both SQL optimization and database caching must
be enabled. Note that Server optimization settings overrid e those on the Client. For more
informa tion, see the topic Setting optimization o ptions for stre ams in Chapter 5 o n p. 60.
With d atabase caching enabled, simply right-click any nonterminal node to cache data at
that point, and the cache will be created au tomatically dire ctly in t he database the next time the
stream is run. If data base caching or SQL opti mization is not enabled, the cache will be writ ten
to the le system instead.