File: drilldown.html

package info (click to toggle)
groonga 11.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 121,576 kB
  • sloc: ansic: 801,209; javascript: 62,121; ruby: 46,206; cpp: 33,790; xml: 24,951; yacc: 13,333; sh: 7,776; python: 3,266; makefile: 2,315; perl: 133
file content (745 lines) | stat: -rw-r--r-- 24,548 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745


<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>4.5. Drilldown &#8212; Groonga v10.1.1-31-g1e46ba6 documentation</title>
    <link rel="stylesheet" href="../_static/groonga.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/language_data.js"></script>
    
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="4.6. Tag search and reverse resolution of reference relationships" href="index.html" />
    <link rel="prev" title="4.4. Various search conditions" href="search.html" /> 
  </head><body>
<div class="header">
  <h1 class="title">
    <a id="top-link" href="../index.html">
      <span class="project">groonga</span>
      <span class="separator">-</span>
      <span class="description">An open-source fulltext search engine and column store.</span>
    </a>
  </h1>

  <div class="other-language-links">
    <ul>
      <li><a href="../../../ja/html/tutorial/drilldown.html">日本語</a></li>
    </ul>
  </div>
</div>
  

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="index.html" title="4.6. Tag search and reverse resolution of reference relationships"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="search.html" title="4.4. Various search conditions"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">Groonga v10.1.1-31-g1e46ba6 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../tutorial.html" accesskey="U"><span class="section-number">4. </span>Tutorial</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><span class="section-number">4.5. </span>Drilldown</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="drilldown">
<h1><span class="section-number">4.5. </span>Drilldown<a class="headerlink" href="#drilldown" title="Permalink to this headline">¶</a></h1>
<p>You learned how to search and sort searched results in the previous sections.
Now that you can search as you likes, but how do you summarize the number of records which has specific value in the column?</p>
<p>As you know, there is a naive solution to execute query by every the value of column, then you can get the number of records as a result. It is a simple way, but it is not reasonable to many records.</p>
<p>If you are familiar with SQL, you will doubt with “Is there a similar SQL functionality to <code class="docutils literal notranslate"><span class="pre">GROUP</span> <span class="pre">BY</span></code> in Groonga?”.</p>
<p>Of course, Groonga provides such a functionality. It’s called as <code class="docutils literal notranslate"><span class="pre">drilldown</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">drilldown</span></code> enables you to get the number of records which belongs to specific the value of column at once.</p>
<p>To illustrate this feature, imagine the case that classification by domain and grouping by country that domain belongs to.</p>
<p>Here is the concrete examples how to use this feature.</p>
<p>In this example, we add two columns to <code class="docutils literal notranslate"><span class="pre">Site</span></code> table. <code class="docutils literal notranslate"><span class="pre">domain</span></code> column is used for TLD (top level domain). <code class="docutils literal notranslate"><span class="pre">country</span></code> column is used for country name. The type of these columns are <code class="docutils literal notranslate"><span class="pre">SiteDomain</span></code> table which uses domain name as a primary key and <code class="docutils literal notranslate"><span class="pre">SiteCountry</span></code> table which uses country name as a primary key.</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>table_create --name SiteDomain --flags TABLE_HASH_KEY --key_type ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create --name SiteCountry --flags TABLE_HASH_KEY --key_type ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table Site --name domain --flags COLUMN_SCALAR --type SiteDomain
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table Site --name country --flags COLUMN_SCALAR --type SiteCountry
# [[0, 1337566253.89858, 0.000355720520019531], true]
load --table Site
[
{&quot;_key&quot;:&quot;http://example.org/&quot;,&quot;domain&quot;:&quot;.org&quot;,&quot;country&quot;:&quot;japan&quot;},
{&quot;_key&quot;:&quot;http://example.net/&quot;,&quot;domain&quot;:&quot;.net&quot;,&quot;country&quot;:&quot;brazil&quot;},
{&quot;_key&quot;:&quot;http://example.com/&quot;,&quot;domain&quot;:&quot;.com&quot;,&quot;country&quot;:&quot;japan&quot;},
{&quot;_key&quot;:&quot;http://example.net/afr&quot;,&quot;domain&quot;:&quot;.net&quot;,&quot;country&quot;:&quot;usa&quot;},
{&quot;_key&quot;:&quot;http://example.org/aba&quot;,&quot;domain&quot;:&quot;.org&quot;,&quot;country&quot;:&quot;korea&quot;},
{&quot;_key&quot;:&quot;http://example.com/rab&quot;,&quot;domain&quot;:&quot;.com&quot;,&quot;country&quot;:&quot;china&quot;},
{&quot;_key&quot;:&quot;http://example.net/atv&quot;,&quot;domain&quot;:&quot;.net&quot;,&quot;country&quot;:&quot;china&quot;},
{&quot;_key&quot;:&quot;http://example.org/gat&quot;,&quot;domain&quot;:&quot;.org&quot;,&quot;country&quot;:&quot;usa&quot;},
{&quot;_key&quot;:&quot;http://example.com/vdw&quot;,&quot;domain&quot;:&quot;.com&quot;,&quot;country&quot;:&quot;japan&quot;}
]
# [[0, 1337566253.89858, 0.000355720520019531], 9]
</pre></div>
</div>
<p>Here is a example of drilldown with <code class="docutils literal notranslate"><span class="pre">domain</span></code> column. Three kind of values are used in <code class="docutils literal notranslate"><span class="pre">domain</span></code> column - “.org”, “.net” and “.com”.</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>select --table Site --limit 0 --drilldown domain
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         9
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;country&quot;,
#           &quot;SiteCountry&quot;
#         ],
#         [
#           &quot;domain&quot;,
#           &quot;SiteDomain&quot;
#         ],
#         [
#           &quot;link&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;links&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;location&quot;,
#           &quot;WGS84GeoPoint&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ]
#     ],
#     [
#       [
#         3
#       ],
#       [
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;_nsubrecs&quot;,
#           &quot;Int32&quot;
#         ]
#       ],
#       [
#         &quot;.org&quot;,
#         3
#       ],
#       [
#         &quot;.net&quot;,
#         3
#       ],
#       [
#         &quot;.com&quot;,
#         3
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
<p>Here is a summary of above query.</p>
<table class="docutils align-default" id="id1">
<caption><span class="caption-text">Drilldown by <code class="docutils literal notranslate"><span class="pre">domain</span></code> column</span><a class="headerlink" href="#id1" title="Permalink to this table">¶</a></caption>
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 33%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Group by</p></th>
<th class="head"><p>The number of group records</p></th>
<th class="head"><p>Group records means following records</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>.org</p></td>
<td><p>3</p></td>
<td><ul class="simple">
<li><p><a class="reference external" href="http://example.org/">http://example.org/</a></p></li>
<li><p><a class="reference external" href="http://example.org/aba">http://example.org/aba</a></p></li>
<li><p><a class="reference external" href="http://example.org/gat">http://example.org/gat</a></p></li>
</ul>
</td>
</tr>
<tr class="row-odd"><td><p>.net</p></td>
<td><p>3</p></td>
<td><ul class="simple">
<li><p><a class="reference external" href="http://example.net/">http://example.net/</a></p></li>
<li><p><a class="reference external" href="http://example.net/afr">http://example.net/afr</a></p></li>
<li><p><a class="reference external" href="http://example.net/atv">http://example.net/atv</a></p></li>
</ul>
</td>
</tr>
<tr class="row-even"><td><p>.com</p></td>
<td><p>3</p></td>
<td><ul class="simple">
<li><p><a class="reference external" href="http://example.com/">http://example.com/</a></p></li>
<li><p><a class="reference external" href="http://example.com/rab">http://example.com/rab</a></p></li>
<li><p><a class="reference external" href="http://example.com/vdw">http://example.com/vdw</a></p></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>The value of drilldown are returned as the value of <code class="docutils literal notranslate"><span class="pre">_nsubrecs</span></code> column. In this case, <code class="docutils literal notranslate"><span class="pre">Site</span></code> table is grouped by “.org”, “.net”, “.com” domain. <code class="docutils literal notranslate"><span class="pre">_nsubrecs</span></code> shows that each three domain has three records.</p>
<p>If you execute drildown to the column which has table as a type, you can get the value of column which is stored in referenced table.
<code class="docutils literal notranslate"><span class="pre">_nsubrecs</span></code> pseudo column is added to the table which is used for drilldown. this pseudo column stores the number of records which is grouped by.</p>
<p>Then, investigate referenced table in detail. As <code class="docutils literal notranslate"><span class="pre">Site</span></code> table use <code class="docutils literal notranslate"><span class="pre">SiteDomain</span></code> table as column type of <code class="docutils literal notranslate"><span class="pre">domain</span></code>, you can use <code class="docutils literal notranslate"><span class="pre">--drilldown_output_columns</span></code> to know detail of referenced column.</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>select --table Site --limit 0 --drilldown domain --drilldown_output_columns _id,_key,_nsubrecs
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         9
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;country&quot;,
#           &quot;SiteCountry&quot;
#         ],
#         [
#           &quot;domain&quot;,
#           &quot;SiteDomain&quot;
#         ],
#         [
#           &quot;link&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;links&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;location&quot;,
#           &quot;WGS84GeoPoint&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ]
#     ],
#     [
#       [
#         3
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;_nsubrecs&quot;,
#           &quot;Int32&quot;
#         ]
#       ],
#       [
#         1,
#         &quot;.org&quot;,
#         3
#       ],
#       [
#         2,
#         &quot;.net&quot;,
#         3
#       ],
#       [
#         3,
#         &quot;.com&quot;,
#         3
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
<p>Now, you can see detail of each grouped domain, drilldown by <code class="docutils literal notranslate"><span class="pre">country</span></code> column which has “.org” as column value.</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>select --table Site --limit 0 --filter &quot;domain._id == 1&quot; --drilldown country
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         3
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;country&quot;,
#           &quot;SiteCountry&quot;
#         ],
#         [
#           &quot;domain&quot;,
#           &quot;SiteDomain&quot;
#         ],
#         [
#           &quot;link&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;links&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;location&quot;,
#           &quot;WGS84GeoPoint&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ]
#     ],
#     [
#       [
#         3
#       ],
#       [
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;_nsubrecs&quot;,
#           &quot;Int32&quot;
#         ]
#       ],
#       [
#         &quot;japan&quot;,
#         1
#       ],
#       [
#         &quot;korea&quot;,
#         1
#       ],
#       [
#         &quot;usa&quot;,
#         1
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
<div class="section" id="drilldown-with-multiple-column">
<h2><span class="section-number">4.5.1. </span>Drilldown with multiple column<a class="headerlink" href="#drilldown-with-multiple-column" title="Permalink to this headline">¶</a></h2>
<p>Drilldown feature supports multiple column. Use comma separated multiple column names as <code class="docutils literal notranslate"><span class="pre">drildown</span></code> parameter.
You can get the each result of drilldown at once.</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>select --table Site --limit 0 --drilldown domain,country
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         9
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;country&quot;,
#           &quot;SiteCountry&quot;
#         ],
#         [
#           &quot;domain&quot;,
#           &quot;SiteDomain&quot;
#         ],
#         [
#           &quot;link&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;links&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;location&quot;,
#           &quot;WGS84GeoPoint&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ]
#     ],
#     [
#       [
#         3
#       ],
#       [
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;_nsubrecs&quot;,
#           &quot;Int32&quot;
#         ]
#       ],
#       [
#         &quot;.org&quot;,
#         3
#       ],
#       [
#         &quot;.net&quot;,
#         3
#       ],
#       [
#         &quot;.com&quot;,
#         3
#       ]
#     ],
#     [
#       [
#         5
#       ],
#       [
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;_nsubrecs&quot;,
#           &quot;Int32&quot;
#         ]
#       ],
#       [
#         &quot;japan&quot;,
#         3
#       ],
#       [
#         &quot;brazil&quot;,
#         1
#       ],
#       [
#         &quot;usa&quot;,
#         2
#       ],
#       [
#         &quot;korea&quot;,
#         1
#       ],
#       [
#         &quot;china&quot;,
#         2
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
</div>
<div class="section" id="sorting-drildown-results">
<h2><span class="section-number">4.5.2. </span>Sorting drildown results<a class="headerlink" href="#sorting-drildown-results" title="Permalink to this headline">¶</a></h2>
<p>Use <code class="docutils literal notranslate"><span class="pre">--drilldown_sort_keys</span></code> if you want to sort the result of drilldown. For example, specify <code class="docutils literal notranslate"><span class="pre">_nsubrecs</span></code> as ascending order.</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>select --table Site --limit 0 --drilldown country --drilldown_sort_keys _nsubrecs
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         9
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;country&quot;,
#           &quot;SiteCountry&quot;
#         ],
#         [
#           &quot;domain&quot;,
#           &quot;SiteDomain&quot;
#         ],
#         [
#           &quot;link&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;links&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;location&quot;,
#           &quot;WGS84GeoPoint&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ]
#     ],
#     [
#       [
#         5
#       ],
#       [
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;_nsubrecs&quot;,
#           &quot;Int32&quot;
#         ]
#       ],
#       [
#         &quot;brazil&quot;,
#         1
#       ],
#       [
#         &quot;korea&quot;,
#         1
#       ],
#       [
#         &quot;usa&quot;,
#         2
#       ],
#       [
#         &quot;china&quot;,
#         2
#       ],
#       [
#         &quot;japan&quot;,
#         3
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
</div>
<div class="section" id="limits-drildown-results">
<h2><span class="section-number">4.5.3. </span>limits drildown results<a class="headerlink" href="#limits-drildown-results" title="Permalink to this headline">¶</a></h2>
<p>The number of drilldown results is limited to 10 as a default. Use <code class="docutils literal notranslate"><span class="pre">drilldown_limit</span></code> and <code class="docutils literal notranslate"><span class="pre">drilldown_offset</span></code> parameter to customize orilldown results.</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>select --table Site --limit 0 --drilldown country --drilldown_sort_keys _nsubrecs --drilldown_limit 2 --drilldown_offset 2
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         9
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;country&quot;,
#           &quot;SiteCountry&quot;
#         ],
#         [
#           &quot;domain&quot;,
#           &quot;SiteDomain&quot;
#         ],
#         [
#           &quot;link&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;links&quot;,
#           &quot;Site&quot;
#         ],
#         [
#           &quot;location&quot;,
#           &quot;WGS84GeoPoint&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ]
#     ],
#     [
#       [
#         5
#       ],
#       [
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;_nsubrecs&quot;,
#           &quot;Int32&quot;
#         ]
#       ],
#       [
#         &quot;usa&quot;,
#         2
#       ],
#       [
#         &quot;china&quot;,
#         2
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
<p>Note that drilldown to the column which stores string is slower than the columns which stores the other types.
If you drilldown to string type of column, create the table that type of primary key is string, then create the column which refers that table.</p>
</div>
</div>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">4.5. Drilldown</a><ul>
<li><a class="reference internal" href="#drilldown-with-multiple-column">4.5.1. Drilldown with multiple column</a></li>
<li><a class="reference internal" href="#sorting-drildown-results">4.5.2. Sorting drildown results</a></li>
<li><a class="reference internal" href="#limits-drildown-results">4.5.3. limits drildown results</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="search.html"
                        title="previous chapter"><span class="section-number">4.4. </span>Various search conditions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="index.html"
                        title="next chapter"><span class="section-number">4.6. </span>Tag search and reverse resolution of reference relationships</a></p>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="index.html" title="4.6. Tag search and reverse resolution of reference relationships"
             >next</a> |</li>
        <li class="right" >
          <a href="search.html" title="4.4. Various search conditions"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">Groonga v10.1.1-31-g1e46ba6 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../tutorial.html" ><span class="section-number">4. </span>Tutorial</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><span class="section-number">4.5. </span>Drilldown</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2009-2021, Brazil, Inc.
    </div>
  </body>
</html>