FT.PROFILE

Syntax

  1. FT.PROFILE index SEARCH [LIMITED] QUERY query

Time complexity: O(N)

Important: New in Dragonfly v1.13. Currently, Dragonfly Search is in Beta.

Description

Apply the FT.SEARCH command to collect performance details.

Required arguments

index

is index name, created using the FT.CREATE command.

QUERY query

is query string, sent to the FT.SEARCH command to collect performance details.

Return

FT.PROFILE returns an array reply. The first element of the returned array has the following elements:

  • took: time in microseconds (μs) used to execute the query.
  • hits: number of documents returned by the query.
  • serialized: number of documents serialized by the query.

The rest of the array elements represent an execution tree on every Dragonfly shard with timings.

Examples

Collect performance information about an index

  1. dragonfly> HSET blog:post:1 title "blog post 1" published_at 1701210030 category "default" description "this is a blog"
  2. (integer) 4
  3. dragonfly> FT.CREATE idx ON HASH PREFIX 1 blog:post: SCHEMA title TEXT SORTABLE published_at NUMERIC SORTABLE category TAG SORTABLE description TEXT NOINDEX
  4. OK
  5. dragonfly> FT.PROFILE idx SEARCH QUERY "@category:{default}"
  6. 1) 1) "took"
  7. 2) (integer) 488
  8. 3) "hits"
  9. 4) (integer) 1
  10. 5) "serialized"
  11. 6) (integer) 1
  12. 2) 1) "took"
  13. 2) (integer) 13
  14. 3) "tree"
  15. 4) 1) t=9 n=0 Field{category}
  16. 2) 1) t=5 n=0 Tags{default}
  17. 3) 1) "took"
  18. 2) (integer) 35
  19. 3) "tree"
  20. 4) 1) t=30 n=0 Field{category}
  21. 2) 1) t=5 n=0 Tags{default}
  22. 4) 1) "took"
  23. 2) (integer) 24
  24. 3) "tree"
  25. 4) 1) t=19 n=0 Field{category}
  26. 2) 1) t=14 n=0 Tags{default}
  27. 5) 1) "took"
  28. 2) (integer) 54
  29. 3) "tree"
  30. 4) 1) t=11 n=1 Field{category}
  31. 2) 1) t=9 n=1 Tags{default}
  32. 6) 1) "took"
  33. 2) (integer) 9
  34. 3) "tree"
  35. 4) 1) t=6 n=0 Field{category}
  36. 2) 1) t=5 n=0 Tags{default}

See also

FT.SEARCH