- Getting started
Before you use Domino® Query Language (DQL), create the equivalent of an internal design catalog in each database against which query requests are processed. The design catalog is maintained in hidden documents within a database and provides a high-speed mechanism to find critical design data at runtime.
- 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.
- contains
New in Domino 11: In addition to using NSF scanning and view indexes, DQL provides the contains
operator to process queries against full text indexes. A database must have a full text index to be processed in this way.
- Formula Language
Beginning in HCL Domino® 12, Formula Language can be used in Domino Query Language (DQL) search terms.
- 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.
- Domino statistics for query analysis
If DQL is deployed on a Domino server, the show stat query command can be used to report statistics about DQL.
- Design catalog
For high speed access to internal information about views and view columns, DQL processing uses a design catalog that contains design data extracted from view notes. Use updall command to add a design catalog to individual databases and to keep the design catalog up to date.
- 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.