class _FilterHints(object):
Class for filter analytics.
When filters are used, the user of the Query
class usually doesn't know exactly which items will be necessary for building the result. It therefore has to prepare and compute the input data for potentially returning everything.
There are two ways to optimize this. The first, and simpler, is to assign each field a group of data, so that the caller can determine which computations are necessary depending on the data groups requested. The list of referenced groups must also be computed for fields referenced in the filter.
The second is restricting the items based on a primary key. The primary key is usually a unique name (e.g. a node name). This class extracts all referenced names from a filter. If it encounters any filter condition which disallows such a list to be determined (e.g. a non-equality filter), all names will be requested.
The end-effect is that any operation other than qlang.OP_OR
and qlang.OP_EQUAL
will make the query more expensive.
Method | __init__ |
Initializes this class. |
Method |
|
Called when handling a binary operation. |
Method |
|
Called when handling a logic operation. |
Method |
|
Called when handling an unary operation. |
Method |
|
Returns all kinds of data referenced by the filter. |
Method |
|
Returns all requested values. |
Method | _ |
Changes internal state to request all names. |
Instance Variable | _allnames |
Undocumented |
Instance Variable | _datakinds |
Undocumented |
Instance Variable | _namefield |
Undocumented |
Instance Variable | _names |
Undocumented |
Called when handling a binary operation.
Parameters | |
op:string | Operator |
datakind | Undocumented |
name:string | Left-hand side of operator (field name) |
value | Right-hand side of operator |