OctoSAM query concepts (preview)¶
OctoSAM queries are used throughout OctoSAM whenever data needs to be presented in a tabular form. The OctoSAM query engine is a configurable template engine optimized for generating sql queries.
Naming conventions¶
Columns in grids keep their database names whenever possible.
PrintableName column¶
Many tables have a PrintableName column. The values in this column are redundantly constructed by OctoSAM based on other key columns of the table. The PrintableName is the name that is often shown for objects outside the grid. Within grids, the column usually has the name of the main object. For example, Machine.PrintableName is displayed as Machine. The construction of the PrintableName attribute is configurable to some extent, this allows for site-specific conventions on what to display.
CurrentDateTime column¶
All queries contain a hidden CurrentDateTime column that contains the start time of the query. This column can be used when exporting data or storing reports.
Dummy column¶
Some queries need a Dummy column to make sure the SQL syntax stays valid even with variable number of columns. This column is usually not displayed at all.
Query performance aspects¶
Performance of a query depends on the amount of data selected, the complexity of the query and the configuration of the database.
Keep indexes current¶
Consult with your DBA on strategies to keep indexes and statistics up-to-date. OctoSAM has built-in tools to optimize the indexes but prefer your estabilshed methods and tools for database maintenance.