Using .value

If a query has a clause that is known not to be a good search candidate, .value will make that clause the last thing evaluated in the query.

For example, consider the two following queries and the SQL they generate. The following examples are not valid queries, but examples to show how .value is used.

Query 1:

rev = "*", type = "A", name = "*", and attribute[A] = 'this'

SQL generated:

(type=="A") && (revision == "*") && (name == "*") && (attribute[A] == 'this')

Query 2:

rev = "*", type = "A", name = "*", and attribute[A].value = 'this'

SQL generated:

(type=="A") && (minorrevision == "*") && (name == "*") )

The difference is the processing order of the query. In query 1, all the clauses are evaluated in order. In query 2, the type, name, and minorrevision clauses are evaluated first, then the result is evaluated with the attribute[A].value clause. The .value takes an attribute that is considered SQL convertible and makes it not SQL convertible. Generally it is done because the final part of the query does not help the search become more efficient due to a schema problem. The work in this case is not done by the database, but by 3DSpace.

When using .value, you should include as much criteria as possible — several ANDs and/or ORs.