Data select by WHERE-expressions
Any operation is based on matched records selection. Any selection is performed according to WHERE-expression. In WHERE-expression the string is like in SQL.
Valid WHERE-expressions may contain brackets, keywords 'and' and 'or', arithmetical and logical operations, field names and numeric and string constants. Functions are not allowed. Superfluous brackets are also not allowed.
Parser converts the WHERE-expression to condition objects tree in several steps:
Valid fields expression may contain brackets, arithmetical operations, field names of one table and numeric and string constants. Functions are not allowed.
During WHERE-expression processing XBSDB creates initial recordset containing all records.
Then XBSDB reduces this recordset on every OR- and AND-expression in tree:
There is an optimization such as zero recordset checking and so on.
Finally XBSDB returns reduced initial recordset as result.
Indexes
Indexes may be built on any correct fields expression. Indexes may increase the selection speed or not - it depends on client's JavaScript engine. In some cases they make 'select' operation faster up to 7 times. Sure, every index makes 'insert' and 'update' operations slower.
Any operation is based on matched records selection. Any selection is performed according to WHERE-expression. In WHERE-expression the string is like in SQL.
Valid WHERE-expressions may contain brackets, keywords 'and' and 'or', arithmetical and logical operations, field names and numeric and string constants. Functions are not allowed. Superfluous brackets are also not allowed.
Parser converts the WHERE-expression to condition objects tree in several steps:
- by brackets to nested levels and to OR-expressions,
- each OR-expression by OR operation to AND-expressions,
- each AND-expression by AND operation to logical expressions,
- each logical expression by =,<,>,<=,>=,!= logical operations to fields expression, logical operation and constant expression,
- each expression by brackets to same-type expressions,
- each expression by arithmetical operations to fields and constants.
Valid fields expression may contain brackets, arithmetical operations, field names of one table and numeric and string constants. Functions are not allowed.
During WHERE-expression processing XBSDB creates initial recordset containing all records.
Then XBSDB reduces this recordset on every OR- and AND-expression in tree:
- OR-expression members get parents' recordset and unite results,
- AND-expression members get previous result and intersect with self one.
There is an optimization such as zero recordset checking and so on.
Finally XBSDB returns reduced initial recordset as result.
Indexes
Indexes may be built on any correct fields expression. Indexes may increase the selection speed or not - it depends on client's JavaScript engine. In some cases they make 'select' operation faster up to 7 times. Sure, every index makes 'insert' and 'update' operations slower.