docs.intersystems.com
Home  /  Application Development: Additional Options  /  Using Globals  /  Temporary Globals and the IRISTEMP Database


Using Globals
Temporary Globals and the IRISTEMP Database
[Back] 
InterSystems: The power behind what matters   
Search:  


For some operations, you may need the power of globals without requiring the data to be saved indefinitely. For example, you may want to use a global to sort some data which you do not need to store to disk. For these operations, InterSystems IRIS provides the mechanism of temporary globals. This mechanism works as follows:
By using temporary globals, you take advantage of the fact that the IRISTEMP database is not journaled. Because the database is not journaled, operations that use the database do not result in journal files. Journal files can become large and can cause space issues. However, note the following points:
Defining a Mapping for Temporary Globals
To define a mapping for temporary globals, do the following:
  1. Choose a naming convention and ensure that all of your developers are aware of it. Note the following points:
  2. In the Management Portal, navigate to the Namespaces page (System Administration > Configuration > System Configuration > Namespaces).
  3. In the row for your application namespace, click Global Mappings.
  4. From the Global Mappings page, click New Global Mapping .
  5. For Global name, enter a name ending in an asterisk (*). Do not include the initial caret of the name.
    For example: AcmeTemp*
    This mapping causes all globals with names that start AcmeTemp* to be mapped to the IRISTEMP database.
  6. Click OK .
    Note:
    >> displayed in the first column of the new mappings row indicates that you opened the mapping for editing.
  7. To save the mappings so that InterSystems IRIS uses them, click Save Changes.
For more details, see the chapter Configuring InterSystems IRIS™ in the System Administration Guide.
System Use of IRISTEMP
Note that InterSystems uses temporary globals as scratch space for optimizing SQL complex queries and for other purposes. It may also uses temporary globals as temporary indices during the execution of certain queries (for sorting, grouping, calculating aggregates, etc.)
Some of the system globals contained in IRISTEMP are:
Never change any of these globals.