- Getting started
DQL processing uses extracted, optimized design data to make intelligent choices about query plans and to work with some of its syntactic elements like view names. To do that, you first need to create and keep up to date that data in a catalog kept in your data directory, named GQFdsgn.cat.
- DQL syntax
DQL can be executed in the LotusScript® or Java™ Query method on the (Notes®) Database object or the domino-db node.js API.
- Examples of simple queries
Here are some examples of simple queries.
- Value data types
Domino® features a typeless data model where any type of data can be stored in any field. In a DQL query, the type of data searched for is defined by the type of data specified in the query term:
- Booleans
Here are some examples that couple simple queries with Boolean processing.
- Precedence
DQL has a natural precedence (order of processing) where ANDed terms are processed before ORed terms.
- in all
The all
keyword modifies the inclusive in
operator to exclude all but a specified list of values.
- Text string values
Text string evaluation is case insensitive and accent insensitive. Use a single quote (') to forces DQL processing to interpret arguments as text rather than date/times or numerals.
- Date and time values
DQL supports the RFC3339 standard format for date-time strings.
- Substitution variables
Since it is useful to run DQL queries that vary only by the values in any given term, it is tempting to build them using string construction. But building DQL queries using string construction can be a security weakness. DQL supports substitution variables in its syntax so a query can remain unchanged but differing values can be supplied.
- View column requirements
DQL processing requires primary collated columns for view access that must meet specific requirements.
- Scanning limits
Though the DQL processing engine takes measures to avoid dominating system resources, it is still possible to write and execute a runaway query. To prevent that, three limit settings are provided.
- Performance and resource use
DQL processing consumes memory, disk, and CPU resources. To preserve those resources and to speed up query processing, optimize your queries as much as possible.
- Design catalog
For high speed access to internal information about views and view columns, DQL processing uses design data extracted from view notes. In this release, this information is stored in a new database, GQFdsgn.cat.
- DomQuery utility
The DomQuery command line utility is shipped with the Domino® server and is used to compose and tune queries. Running it with the explain
(-e
) flag is instrumental in understanding and optimizing DQL syntax and how queries are processed.
- explain
The best way to understand how DQL syntax will be processed is by using the explain facility. Explain is available as a method in the DominoQuery class (Java) and NotesDominoQuery class (LotusScript) and with the DomQuery utility using the explain (-e)
flag.