IBM 15 Switch User Manual


 
51
Building Streams
Figure 5-12
Caching at the Type node to store newly derived fields
To Enable a Cache
E On the stream c anvas, right-click the node and click Cache on the menu.
E On the caching subme nu, click Enable.
E You can turn the cach e o ff by right-clicking the node and clicking Disable on the caching submenu .
Caching Nodes in a Database
For streams run in a database, data can be cache d midstream to a temporary table in the database
rather than the le system. When combined with SQL optimization, this may result in signicant
gains in per form ance. For exampl e, th e output from a stream that merges multiple tables to create
a data mining view may be cached and reused as needed. By automatically generating SQL for
all downstream nodes, performance can be fu r ther improved.
When using database caching with strings longer than 255 characters, 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 of the default_sql_string_length parameter in the options.cfg le. Doing
so ensures that the corresponding column in the temporary 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 override th ose on the Client. For more
informa tion, see the topic Setting optimiza tion options for streams on p. 60.
With database caching enabled, simply right-click any nonterminal node to cache data at
that point, and the cache will be created automatically directly in the database the next time the
stream is run . If databas e caching or SQL optimization is not enab led, the ca che will be written
to the le system instead.