Session: Querying: Debugging: How to include Query Timings

By default, detailed timings (duration of Lucene search, loading documents, transforming results) in queries are turned off, this is due to small overhead that calculation of such timings produces.

Syntax

IDocumentQuery<T> timings(Reference<QueryTimings> timings);

Example

Reference<QueryTimings> timingsRef = new Reference<>();
List<Product> resultsWithTimings = session.advanced().documentQuery(Product.class)
    .timings(timingsRef)
    .search("Name", "Syrup")
    .toList();

Map<String, QueryTimings> timingsMap = timingsRef.value.getTimings();
from Products 
where search(Name, 'Syrup')
include timings()

When you run the query with include timings() in Studio, extra tab appears.

Figure 1. Include timings graphical results

Include timings results