Took vs profile API time_in_nanos

I have a query that I run and it says:
{
"took": 1
...
}

And then when I tack on "profile": true

It shows me the top-level query (which is inclusive of all children from what I read) has a response of:
{
"time": "6.6ms",
"time_in_nanos": 6610556
...
}

What's the difference and why does profile say my query takes longer, but took says shorter?

Hi,

in the docs we state:

The Profile API is a debugging tool and adds significant overhead to search execution.

So the difference is likely caused by the profile API itself.

Daniel

Yep, @danielmitterdorfer is exactly correct. Profiling adds a fair amount of overhead, so all profiling results should be considered relative (e.g. the different parts in the query relative to each other), not absolute times.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.