Skip to content

Commit e187f21

Browse files
committed
DEV: flesh out FT.PROFILE command page
1 parent 57a76bf commit e187f21

File tree

1 file changed

+258
-65
lines changed

1 file changed

+258
-65
lines changed

content/commands/ft.profile/index.md

Lines changed: 258 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ syntax_str: <SEARCH | AGGREGATE> [LIMITED] QUERY query
5151
title: FT.PROFILE
5252
---
5353

54-
Apply [`FT.SEARCH`]({{< baseurl >}}/commands/ft.search/) or [`FT.AGGREGATE`]({{< baseurl >}}/commands/ft.aggregate/) command to collect performance details
54+
Apply [`FT.SEARCH`]({{< baseurl >}}/commands/ft.search/) or [`FT.AGGREGATE`]({{< baseurl >}}/commands/ft.aggregate/) command to collect performance details.
5555

5656
[Examples](#examples)
5757

@@ -104,71 +104,264 @@ Return value has an array with two elements:
104104
<details open>
105105
<summary><b>Collect performance information about an index</b></summary>
106106

107+
Imagine you have a dataset consisting of 1M JSON documents, each with the following structure.
108+
109+
```json
110+
{
111+
"fid": "5x2i3a4s2l",
112+
"key_name": "25450229-6221-445c-b3ec-0b69c5c423db",
113+
"quote": "What a piece of work is man! how noble in reason! how infinite in faculty! in form and moving how express and admirable! in action how like an angel! in apprehension how like a god! the beauty of the world, the paragon of animals! .",
114+
"color": "blue",
115+
"num": 141
116+
}
117+
```
118+
119+
You've created an index similar to the following.
120+
121+
```bash
122+
FT.CREATE idx ON JSON PREFIX 1 key: SCHEMA $.num AS num NUMERIC SORTABLE $.color AS color TAG SORTABLE UNF $.quote AS quote TEXT NOSTEM SORTABLE
123+
```
124+
125+
Next, you run the `FT.PROFILE` command with a search you intend to run on the index.
126+
107127
{{< highlight bash >}}
108-
127.0.0.1:6379> FT.PROFILE idx SEARCH QUERY "hello world"
109-
1) 1) (integer) 1
110-
2) "doc1"
111-
3) 1) "t"
112-
2) "hello world"
113-
2) 1) 1) Total profile time
114-
2) "0.47199999999999998"
115-
2) 1) Parsing time
116-
2) "0.218"
117-
3) 1) Pipeline creation time
118-
2) "0.032000000000000001"
119-
4) 1) Iterators profile
120-
2) 1) Type
121-
2) INTERSECT
122-
3) Time
123-
4) "0.025000000000000001"
124-
5) Counter
125-
6) (integer) 1
126-
7) Child iterators
127-
8) 1) Type
128-
2) TEXT
129-
3) Term
130-
4) hello
131-
5) Time
132-
6) "0.0070000000000000001"
133-
7) Counter
134-
8) (integer) 1
135-
9) Size
136-
10) (integer) 1
137-
9) 1) Type
138-
2) TEXT
139-
3) Term
140-
4) world
141-
5) Time
142-
6) "0.0030000000000000001"
143-
7) Counter
144-
8) (integer) 1
145-
9) Size
146-
10) (integer) 1
147-
5) 1) Result processors profile
148-
2) 1) Type
149-
2) Index
150-
3) Time
151-
4) "0.036999999999999998"
152-
5) Counter
153-
6) (integer) 1
154-
3) 1) Type
155-
2) Scorer
156-
3) Time
157-
4) "0.025000000000000001"
158-
5) Counter
159-
6) (integer) 1
160-
4) 1) Type
161-
2) Sorter
162-
3) Time
163-
4) "0.013999999999999999"
164-
5) Counter
165-
6) (integer) 1
166-
5) 1) Type
167-
2) Loader
168-
3) Time
169-
4) "0.10299999999999999"
170-
5) Counter
171-
6) (integer) 1
128+
127.0.0.1:6379> FT.PROFILE idx SEARCH QUERY '((@num:[100 100] -@color:{blue} @quote:question) | @num:[200 600])' RETURN 1 $.fid
129+
1) "106898" search results
130+
2) "key:0cad5563-151f-4f9c-8bcc-398f82913e14"
131+
3) 1) "$.fid"
132+
2) "8v0x3m7n2z"
133+
4) "key:2316d075-27b7-4c7c-9f2f-f1fe09d53d4e"
134+
5) 1) "$.fid"
135+
2) "8j6q8t3b5g"
136+
...
137+
21) 1) "$.fid"
138+
2) "0y5q3d1y1m"
139+
140+
141+
22) 1) "Shard #1" profile information
142+
2) 1) "Total profile time"
143+
2) "500"
144+
3) 1) "Parsing time"
145+
2) "0"
146+
4) 1) "Pipeline creation time"
147+
2) "0"
148+
5) 1) "Warning"
149+
2) "Timeout limit was reached"
150+
6) 1) "Iterators profile"
151+
2) 1) "Type"
152+
2) "UNION"
153+
3) "Query type"
154+
4) "UNION"
155+
5) "Time"
156+
6) "256"
157+
7) "Counter"
158+
8) "53099"
159+
9) "Child iterators"
160+
10) 1) "Type"
161+
2) "INTERSECT"
162+
3) "Time"
163+
4) "7"
164+
5) "Counter"
165+
6) "149"
166+
7) "Child iterators"
167+
8) 1) "Type"
168+
2) "NUMERIC"
169+
3) "Term"
170+
4) "75 - 112"
171+
5) "Time"
172+
6) "0"
173+
7) "Counter"
174+
8) "149"
175+
9) "Size"
176+
10) "6383"
177+
9) 1) "Type"
178+
2) "NOT"
179+
3) "Time"
180+
4) "6"
181+
5) "Counter"
182+
6) "149"
183+
7) "Child iterator"
184+
8) 1) "Type"
185+
2) "INTERSECT"
186+
3) "Time"
187+
4) "6"
188+
5) "Counter"
189+
6) "130"
190+
7) "Child iterators"
191+
8) 1) "Type"
192+
2) "TAG"
193+
3) "Term"
194+
4) "blue"
195+
5) "Time"
196+
6) "1"
197+
7) "Counter"
198+
8) "1638"
199+
9) "Size"
200+
10) "16123"
201+
9) 1) "Type"
202+
2) "TEXT"
203+
3) "Term"
204+
4) "question"
205+
5) "Time"
206+
6) "1"
207+
7) "Counter"
208+
8) "1595"
209+
9) "Size"
210+
10) "27773"
211+
11) 1) "Type"
212+
2) "UNION"
213+
3) "Query type"
214+
4) "NUMERIC"
215+
5) "Time"
216+
6) "154"
217+
7) "Counter"
218+
8) "52951"
219+
9) "Child iterators"
220+
10) 1) "Type"
221+
2) "NUMERIC"
222+
3) "Term"
223+
4) "189 - 227"
224+
5) "Time"
225+
6) "3"
226+
7) "Counter"
227+
8) "3779"
228+
9) "Size"
229+
10) "6637"
230+
11) 1) "Type"
231+
2) "NUMERIC"
232+
3) "Term"
233+
4) "228 - 265"
234+
5) "Time"
235+
6) "4"
236+
7) "Counter"
237+
8) "4947"
238+
9) "Size"
239+
10) "6288"
240+
12) 1) "Type"
241+
2) "NUMERIC"
242+
3) "Term"
243+
4) "266 - 304"
244+
5) "Time"
245+
6) "4"
246+
7) "Counter"
247+
8) "5122"
248+
9) "Size"
249+
10) "6409"
250+
13) 1) "Type"
251+
2) "NUMERIC"
252+
3) "Term"
253+
4) "305 - 341"
254+
5) "Time"
255+
6) "4"
256+
7) "Counter"
257+
8) "4959"
258+
9) "Size"
259+
10) "6199"
260+
14) 1) "Type"
261+
2) "NUMERIC"
262+
3) "Term"
263+
4) "342 - 378"
264+
5) "Time"
265+
6) "4"
266+
7) "Counter"
267+
8) "4786"
268+
9) "Size"
269+
10) "6088"
270+
15) 1) "Type"
271+
2) "NUMERIC"
272+
3) "Term"
273+
4) "379 - 415"
274+
5) "Time"
275+
6) "4"
276+
7) "Counter"
277+
8) "4789"
278+
9) "Size"
279+
10) "6064"
280+
16) 1) "Type"
281+
2) "NUMERIC"
282+
3) "Term"
283+
4) "416 - 453"
284+
5) "Time"
285+
6) "4"
286+
7) "Counter"
287+
8) "4955"
288+
9) "Size"
289+
10) "6227"
290+
17) 1) "Type"
291+
2) "NUMERIC"
292+
3) "Term"
293+
4) "454 - 488"
294+
5) "Time"
295+
6) "4"
296+
7) "Counter"
297+
8) "4778"
298+
9) "Size"
299+
10) "6031"
300+
18) 1) "Type"
301+
2) "NUMERIC"
302+
3) "Term"
303+
4) "489 - 524"
304+
5) "Time"
305+
6) "4"
306+
7) "Counter"
307+
8) "4765"
308+
9) "Size"
309+
10) "6011"
310+
19) 1) "Type"
311+
2) "NUMERIC"
312+
3) "Term"
313+
4) "525 - 559"
314+
5) "Time"
315+
6) "4"
316+
7) "Counter"
317+
8) "4631"
318+
9) "Size"
319+
10) "5790"
320+
20) 1) "Type"
321+
2) "NUMERIC"
322+
3) "Term"
323+
4) "560 - 595"
324+
5) "Time"
325+
6) "4"
326+
7) "Counter"
327+
8) "4821"
328+
9) "Size"
329+
10) "6083"
330+
21) 1) "Type"
331+
2) "NUMERIC"
332+
3) "Term"
333+
4) "596 - 625"
334+
5) "Time"
335+
6) "0"
336+
7) "Counter"
337+
8) "630"
338+
9) "Size"
339+
10) "5002"
340+
7) 1) "Result processors profile"
341+
2) 1) "Type"
342+
2) "Index"
343+
3) "Time"
344+
4) "356"
345+
5) "Counter"
346+
6) "53099"
347+
3) 1) "Type"
348+
2) "Scorer"
349+
3) "Time"
350+
4) "96"
351+
5) "Counter"
352+
6) "53099"
353+
4) 1) "Type"
354+
2) "Sorter"
355+
3) "Time"
356+
4) "48"
357+
5) "Counter"
358+
6) "10"
359+
5) 1) "Type"
360+
2) "Loader"
361+
3) "Time"
362+
4) "0"
363+
5) "Counter"
364+
6) "10"
172365
{{< / highlight >}}
173366
</details>
174367

0 commit comments

Comments
 (0)