SELECT
clause for OTQL) multiplied by the number of objects queried.SELECT {profiles { name } activities { ts }} FROM UserPoint
Here the SELECT
clause contains two distinct collections: profiles
(which is typed as the standard object type UserProfile
in the schema) and activities
(UserActivity
in the schema). The number of READ would then be 2 multiplied by the number of user points queried.SELECT {profiles { name creation_ts }} FROM UserPoint
Here the SELECT
clause contains only one collection: profiles
. The number of READ would then be 1 multiplied by the number of user points queried.SELECT { id } FROM UserPoint
Here the SELECT
clause is considered to contain one collection (the UserPoint
). The number of READ would then be 1 multiplied by the number of user points queried.SELECT { id profiles { name }} FROM UserPoint
would be counted as 2 multiplied by the number of user points queried as both UserPoint
(through the id
property) and UserProfile
(through the name
property) collections are in the SELECT
clause.@count
operations, the READ number is 0, since no collection is in the SELECT
clause.SELECT { id profiles { name }} FROM UserPoint
example above, the READ number here would be counted as 2 multiplied by the number of user points queried (which is always 1 in the case of GraphQL queries, see below) as both UserPoint
(through the id
and creation_ts
properties) and UserProfile
(through the gender
property) collections are in the query.UserSegment
would have been created on each of those 1000 user points.UserSegment
objects on 500 user pointsUserSegment
objects on 1000 user pointsWHERE
clause:WHERE
clause is empty, the SCAN measure will be equal to the size of the collection in the FROM
clause of the queryWHERE
clause is not empty and there is only one collection in the WHERE
clause (or properties linked to the collection in the FROM
clause), the SCAN measure will be equal to the size of the collection in the WHERE
clauseWHERE
clause is not empty and there are several (distinct) collections in the WHERE
clauseAND
operator, the SCAN measure will be equal to the smallest of collection sizes in the WHERE
clauseOR
operator, the SCAN measure will be equal to the sum of the (distinct) collection sizes in the WHERE
clauseAND
and OR
operators, the same rules will be applied as sub-operations in the order of operations defined by the querySELECT { id } FROM UserPoint
Here the WHERE
clause is empty so the SCAN number will be equal to the size of the UserPoint
collection.SELECT @count{} FROM UserProfile WHERE gender = "W"
Here the WHERE
clause is not empty and contains only a property directly linked to the collection in the FROM
clause, so the SCAN number will be equal to the size of the UserProfile
collection.SELECT @count{} FROM UserPoint WHERE accounts{} AND NOT emails{}
Here the WHERE
clause is not empty and contains several collections: UserAccount
(through accounts
) and UserEmail
(through emails
). Both are separated by an AND
operator so the SCAN number will be equal to the smallest collection between the UserAccount
and UserEmail
collections.SELECT @count{} FROM UserPoint WHERE accounts{} OR emails{}
Here the WHERE
clause is not empty and contains several collections: UserAccount
(through accounts
) and UserEmail
(through emails
). Both are separated by an OR
operator so the SCAN number will be equal to the sum of distinct collection sizes. UserAccount
and UserEmail
being distinct collections, the SCAN number will be the sum of their collection sizes.SELECT {id} FROM UserPoint WHERE events {ts > "2020-06-20" AND name = "$basket_view"} OR ( scenarios {scenario_id="1785"} AND is_defined(emails) )
Here the WHERE
clause is not empty and contains several collections: UserEvent
(through events
), UserScenario
(through scenarios
) and UserEmail
(through emails
). These collections are separated by a mix of AND
and OR
operators, so we have to consider the order of operations:UserScenario
and UserEmail
are separated by an AND
operator, the SCAN number here will be equal to the smallest of collection size of the two.UserEvent
and the sub-operation we've just considered. These are separated by an OR
operator so the SCAN number will be the sum of the UserEvent
collection size and the SCAN number we've found for the sub-operation between brackets.