File: io_flush.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 (642 lines) | stat: -rw-r--r-- 39,265 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


<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>7.3.24. io_flush &#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="7.3.25. load" href="load.html" />
    <link rel="prev" title="7.3.23. index_column_diff" href="index_column_diff.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/reference/commands/io_flush.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="load.html" title="7.3.25. load"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index_column_diff.html" title="7.3.23. index_column_diff"
             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="../../reference.html" ><span class="section-number">7. </span>Reference manual</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../command.html" accesskey="U"><span class="section-number">7.3. </span>Command</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><span class="section-number">7.3.24. </span><code class="docutils literal notranslate"><span class="pre">io_flush</span></code></a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="io-flush">
<h1><span class="section-number">7.3.24. </span><code class="docutils literal notranslate"><span class="pre">io_flush</span></code><a class="headerlink" href="#io-flush" title="Permalink to this headline">¶</a></h1>
<div class="section" id="summary">
<h2><span class="section-number">7.3.24.1. </span>Summary<a class="headerlink" href="#summary" title="Permalink to this headline">¶</a></h2>
<div class="versionadded">
<p><span class="versionmodified added">New in version 5.0.5.</span></p>
</div>
<p><code class="docutils literal notranslate"><span class="pre">io_flush</span></code> flushes all changes in memory to disk
explicitly. Normally, you don’t need to use <code class="docutils literal notranslate"><span class="pre">io_flush</span></code>
explicitly. Because flushing is done automatically by OS. And flushing
by OS is effective.</p>
<p>You need to use <code class="docutils literal notranslate"><span class="pre">io_flush</span></code> explicitly when your system may often
crash unexpectedly or you may not shutdown your Groonga process in a
normal way. (For example, using <a class="reference internal" href="shutdown.html"><span class="doc">shutdown</span></a> is a normal shutdown
process.) It’s better that you use <code class="docutils literal notranslate"><span class="pre">io_flush</span></code> after you change your
Groonga database for the case. Here are commands that change your
Groonga database:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="column_create.html"><span class="doc">column_create</span></a></p></li>
<li><p><a class="reference internal" href="column_remove.html"><span class="doc">column_remove</span></a></p></li>
<li><p><a class="reference internal" href="column_rename.html"><span class="doc">column_rename</span></a></p></li>
<li><p><a class="reference internal" href="delete.html"><span class="doc">delete</span></a></p></li>
<li><p><a class="reference internal" href="load.html"><span class="doc">load</span></a></p></li>
<li><p><a class="reference internal" href="logical_table_remove.html"><span class="doc">logical_table_remove</span></a></p></li>
<li><p><a class="reference internal" href="object_remove.html"><span class="doc">object_remove</span></a></p></li>
<li><p><a class="reference internal" href="plugin_register.html"><span class="doc">plugin_register</span></a></p></li>
<li><p><a class="reference internal" href="plugin_unregister.html"><span class="doc">plugin_unregister</span></a></p></li>
<li><p><a class="reference internal" href="table_create.html"><span class="doc">table_create</span></a></p></li>
<li><p><a class="reference internal" href="table_remove.html"><span class="doc">table_remove</span></a></p></li>
<li><p><a class="reference internal" href="table_rename.html"><span class="doc">table_rename</span></a></p></li>
<li><p><a class="reference internal" href="truncate.html"><span class="doc">truncate</span></a></p></li>
</ul>
</div></blockquote>
<p>If you’re using <a class="reference internal" href="select.html#select-scorer"><span class="std std-ref">scorer</span></a> parameter in <a class="reference internal" href="select.html"><span class="doc">select</span></a> to
change existing column values, <a class="reference internal" href="select.html"><span class="doc">select</span></a> is added to the above
list.</p>
<p>Note that <code class="docutils literal notranslate"><span class="pre">io_flush</span></code> may be a heavy process. If there are many
changes in memory, flushing them to disk is a heavy process.</p>
<div class="versionadded">
<p><span class="versionmodified added">New in version 8.0.8: </span><code class="docutils literal notranslate"><span class="pre">io_flush</span></code> locks Groonga database while flushing. It means that
you can’t run the following commands while <code class="docutils literal notranslate"><span class="pre">io_flush</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="column_create.html"><span class="doc">column_create</span></a></p></li>
<li><p><a class="reference internal" href="column_remove.html"><span class="doc">column_remove</span></a></p></li>
<li><p><a class="reference internal" href="column_rename.html"><span class="doc">column_rename</span></a></p></li>
<li><p><a class="reference internal" href="logical_table_remove.html"><span class="doc">logical_table_remove</span></a></p></li>
<li><p><a class="reference internal" href="object_remove.html"><span class="doc">object_remove</span></a></p></li>
<li><p><a class="reference internal" href="plugin_register.html"><span class="doc">plugin_register</span></a></p></li>
<li><p><a class="reference internal" href="plugin_unregister.html"><span class="doc">plugin_unregister</span></a></p></li>
<li><p><a class="reference internal" href="table_create.html"><span class="doc">table_create</span></a></p></li>
<li><p><a class="reference internal" href="table_remove.html"><span class="doc">table_remove</span></a></p></li>
<li><p><a class="reference internal" href="table_rename.html"><span class="doc">table_rename</span></a></p></li>
</ul>
</div></blockquote>
</div>
</div>
<div class="section" id="syntax">
<h2><span class="section-number">7.3.24.2. </span>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<p>This command takes three parameters.</p>
<p>All parameters are optional:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush [target_name=null]
         [recursive=yes]
         [only_opened=no]
</pre></div>
</div>
<div class="versionadded">
<p><span class="versionmodified added">New in version 7.0.4: </span><a class="reference internal" href="#io-flush-only-opened"><span class="std std-ref">only_opened</span></a> is added.</p>
</div>
<div class="versionadded">
<p><span class="versionmodified added">New in version 9.0.2: </span><code class="docutils literal notranslate"><span class="pre">--recursive</span> <span class="pre">dependent</span></code> option is added. It is recommended way to flush
target object and its related objects since 9.0.2. See <a class="reference internal" href="#io-flush-recursive"><span class="std std-ref">recursive</span></a> about details.</p>
</div>
</div>
<div class="section" id="usage">
<h2><span class="section-number">7.3.24.3. </span>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
<p>You can flush all changes in memory to disk with no arguments:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>If you know what is changed, you can narrow flush targets. Here is a
correspondence table between command and flush targets for Groonga 9.0.2 or later.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>There is a different recommended way which depends on Groonga version.
If Groonga is 9.0.1 or earlier ( <code class="docutils literal notranslate"><span class="pre">--recursive</span> <span class="pre">dependent</span></code> is not available ), you
need to flush related objects explicitly, otherwise, using <code class="docutils literal notranslate"><span class="pre">--recursive</span> <span class="pre">dependent</span></code>
is a recommended way not to forget flush target objects.</p>
</div>
<table class="docutils align-default">
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 33%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Command</p></th>
<th class="head"><p>Flush targets</p></th>
<th class="head"><p><code class="docutils literal notranslate"><span class="pre">io_flush</span></code> arguments</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="load.html"><span class="doc">load</span></a> and <a class="reference internal" href="delete.html"><span class="doc">delete</span></a></p></td>
<td><p>Target table and its columns.</p>
<p>If there are one or more reference columns in these columns,
referenced tables are also flush targets.</p>
<p>If there are one or more indexed columns in these columns,
tables of corresponding index columns and corresponding index
columns are also flush targets.</p>
</td>
<td><p>Use <code class="docutils literal notranslate"><span class="pre">--recursive</span> <span class="pre">dependent</span></code> to flush target table and
its columns, referenced tables and tables of corresponding index columns
and corresponding index columns at once:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME --recursive dependent
</pre></div>
</div>
</td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="truncate.html"><span class="doc">truncate</span></a></p></td>
<td><p>Target table and its columns.</p>
<p>If there are one or more reference columns in these columns,
referenced tables are also flush targets.</p>
<p>If there are one or more indexed columns in these columns,
tables of corresponding index columns and corresponding index
columns are also flush targets.</p>
<p>Database is also flush target.</p>
</td>
<td><p>Use <code class="docutils literal notranslate"><span class="pre">--recursive</span> <span class="pre">dependent</span></code> to flush target table and its columns,
referenced tables and tables of corresponding index columns and corresponding index
columns at once:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME --recursive dependent
</pre></div>
</div>
</td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="table_create.html"><span class="doc">table_create</span></a></p></td>
<td><p>Target table and database.</p></td>
<td><p>Table:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME --recursive dependent
</pre></div>
</div>
</td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="table_remove.html"><span class="doc">table_remove</span></a>, <a class="reference internal" href="table_rename.html"><span class="doc">table_rename</span></a> and <a class="reference internal" href="logical_table_remove.html"><span class="doc">logical_table_remove</span></a></p></td>
<td><p>Database.</p></td>
<td><p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="column_create.html"><span class="doc">column_create</span></a></p></td>
<td><p>Target column and database.</p></td>
<td><p>Table:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME.COLUMN_NAME --recursive dependent
</pre></div>
</div>
</td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="column_remove.html"><span class="doc">column_remove</span></a> and <a class="reference internal" href="column_rename.html"><span class="doc">column_rename</span></a></p></td>
<td><p>Database.</p></td>
<td><p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plugin_register.html"><span class="doc">plugin_register</span></a> and <a class="reference internal" href="plugin_unregister.html"><span class="doc">plugin_unregister</span></a></p></td>
<td><p>Database.</p></td>
<td><p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
</tbody>
</table>
<p>If Groonga is 9.0.1 or earlier ( <code class="docutils literal notranslate"><span class="pre">--recursive</span> <span class="pre">dependent</span></code> is not available ), flush
objects explicitly. Here is a correspondence table between command and flush targets
for Groonga 9.0.1 or earlier.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 33%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Command</p></th>
<th class="head"><p>Flush targets</p></th>
<th class="head"><p><code class="docutils literal notranslate"><span class="pre">io_flush</span></code> arguments</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="load.html"><span class="doc">load</span></a> and <a class="reference internal" href="delete.html"><span class="doc">delete</span></a></p></td>
<td><p>Target table and its columns.</p>
<p>If there are one or more reference columns in these columns,
referenced tables are also flush targets.</p>
<p>If there are one or more indexed columns in these columns,
tables of corresponding index columns and corresponding index
columns are also flush targets.</p>
</td>
<td><p>Table and its columns:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME
</pre></div>
</div>
<p>A referenced table:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name REFERENCED_TABLE_NAME --recursive no
</pre></div>
</div>
<p>A table of an index column:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME_OF_INDEX_COLUMN --recursive no
</pre></div>
</div>
<p>An index column:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME_OF_INDEX_COLUMN.INDEX_COLUMN
</pre></div>
</div>
</td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="truncate.html"><span class="doc">truncate</span></a></p></td>
<td><p>Target table and its columns.</p>
<p>If there are one or more reference columns in these columns,
referenced tables are also flush targets.</p>
<p>If there are one or more indexed columns in these columns,
tables of corresponding index columns and corresponding index
columns are also flush targets.</p>
<p>Database is also flush target.</p>
</td>
<td><p>Table and its columns:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME
</pre></div>
</div>
<p>A referenced table:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name REFERENCED_TABLE_NAME --recursive no
</pre></div>
</div>
<p>A table of an index column:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME_OF_INDEX_COLUMN --recursive no
</pre></div>
</div>
<p>An index column:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME_OF_INDEX_COLUMN.INDEX_COLUMN
</pre></div>
</div>
<p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="table_create.html"><span class="doc">table_create</span></a></p></td>
<td><p>Target table and database.</p></td>
<td><p>Table:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME
</pre></div>
</div>
<p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="table_remove.html"><span class="doc">table_remove</span></a>, <a class="reference internal" href="table_rename.html"><span class="doc">table_rename</span></a> and <a class="reference internal" href="logical_table_remove.html"><span class="doc">logical_table_remove</span></a></p></td>
<td><p>Database.</p></td>
<td><p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="column_create.html"><span class="doc">column_create</span></a></p></td>
<td><p>Target column and database.</p></td>
<td><p>Table:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME.COLUMN_NAME
</pre></div>
</div>
<p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="column_remove.html"><span class="doc">column_remove</span></a> and <a class="reference internal" href="column_rename.html"><span class="doc">column_rename</span></a></p></td>
<td><p>Database.</p></td>
<td><p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plugin_register.html"><span class="doc">plugin_register</span></a> and <a class="reference internal" href="plugin_unregister.html"><span class="doc">plugin_unregister</span></a></p></td>
<td><p>Database.</p></td>
<td><p>Database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
</pre></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="parameters">
<h2><span class="section-number">7.3.24.4. </span>Parameters<a class="headerlink" href="#parameters" title="Permalink to this headline">¶</a></h2>
<p>This section describes all parameters.</p>
<div class="section" id="required-parameters">
<h3><span class="section-number">7.3.24.4.1. </span>Required parameters<a class="headerlink" href="#required-parameters" title="Permalink to this headline">¶</a></h3>
<p>There is no required parameter.</p>
</div>
<div class="section" id="optional-parameters">
<h3><span class="section-number">7.3.24.4.2. </span>Optional parameters<a class="headerlink" href="#optional-parameters" title="Permalink to this headline">¶</a></h3>
<p>There are optional parameters.</p>
<div class="section" id="target-name">
<span id="io-flush-target-name"></span><h4><span class="section-number">7.3.24.4.2.1. </span><code class="docutils literal notranslate"><span class="pre">target_name</span></code><a class="headerlink" href="#target-name" title="Permalink to this headline">¶</a></h4>
<p>Specifies a target object name. Target object is one of database,
table or column.</p>
<p>If you omit this parameter, database is the target object:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>If you specify a table name, the table is the target object:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>table_create Users TABLE_HASH_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
io_flush --target_name Users
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>If you specify a column name, the column is the target object:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>column_create Users age COLUMN_SCALAR UInt8
# [[0, 1337566253.89858, 0.000355720520019531], true]
io_flush --target_name Users.age
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
</div>
<div class="section" id="recursive">
<span id="io-flush-recursive"></span><h4><span class="section-number">7.3.24.4.2.2. </span><code class="docutils literal notranslate"><span class="pre">recursive</span></code><a class="headerlink" href="#recursive" title="Permalink to this headline">¶</a></h4>
<p>Specifies whether child objects of the target object are also target
objects.</p>
<p>Child objects of database are all tables and all columns.</p>
<p>Child objects of table are all its columns.</p>
<p>Child objects of column are nothing.</p>
<p>If you specify <code class="docutils literal notranslate"><span class="pre">yes</span></code> to <a class="reference internal" href="#io-flush-only-opened"><span class="std std-ref">only_opened</span></a>, <code class="docutils literal notranslate"><span class="pre">recursive</span></code>
is ignored.</p>
<p><code class="docutils literal notranslate"><span class="pre">recursive</span></code> value must be <code class="docutils literal notranslate"><span class="pre">yes</span></code>, <code class="docutils literal notranslate"><span class="pre">no</span></code> or <code class="docutils literal notranslate"><span class="pre">dependent</span></code>. <code class="docutils literal notranslate"><span class="pre">yes</span></code>
means that all of the specified target object and child objects are
the target objects. <code class="docutils literal notranslate"><span class="pre">no</span></code> means that only the specified target object
is the target object. <code class="docutils literal notranslate"><span class="pre">dependent</span></code> means that all of the specified
target object, child objects, corresponding table of index column and
corresponding index column are the target objects.</p>
<p>The following <code class="docutils literal notranslate"><span class="pre">io_flush</span></code> flushes all changes in database, all tables
and all columns:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive yes
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>The following <code class="docutils literal notranslate"><span class="pre">io_flush</span></code> flushes all changes only in database:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive no
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>If you specify other value (not <code class="docutils literal notranslate"><span class="pre">yes</span></code> neither <code class="docutils literal notranslate"><span class="pre">no</span></code>) or omit
<code class="docutils literal notranslate"><span class="pre">recursive</span></code> parameter, <code class="docutils literal notranslate"><span class="pre">yes</span></code> is used.</p>
<p><code class="docutils literal notranslate"><span class="pre">yes</span></code> is used in the following case because invalid <code class="docutils literal notranslate"><span class="pre">recursive</span></code>
argument is specified:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --recursive invalid
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">yes</span></code> is used in the following case because <code class="docutils literal notranslate"><span class="pre">recursive</span></code> parameter
isn’t specified:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>Since 9.0.2, <code class="docutils literal notranslate"><span class="pre">--recursive</span> <span class="pre">dependent</span></code> is added to flush not only target object
and child objects, but also related objects. The related objects are:</p>
<ul class="simple">
<li><p>A referenced table</p></li>
<li><p>A related index column (There is source column in target <code class="docutils literal notranslate"><span class="pre">TABLE_NAME</span></code>)</p></li>
<li><p>A table of related index column (There is source column in target <code class="docutils literal notranslate"><span class="pre">TABLE_NAME</span></code>)</p></li>
</ul>
<p>It is useful not to forget flushing related objects.</p>
<p>For example, <code class="docutils literal notranslate"><span class="pre">--recursive</span> <span class="pre">dependent</span></code> is specified for <code class="docutils literal notranslate"><span class="pre">TABLE_NAME</span></code>, this
option executes equivalent to the following commands internally.</p>
<ul>
<li><p>Flush table and its columns:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME --recursive yes
</pre></div>
</div>
</li>
<li><p>Flush a referenced table:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name REFERENCED_TABLE_NAME --recursive no
</pre></div>
</div>
</li>
<li><p>Flush a related index column (There is source column in <code class="docutils literal notranslate"><span class="pre">TABLE_NAME</span></code>):</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME_OF_INDEX_COLUMN.INDEX_COLUMN
</pre></div>
</div>
</li>
<li><p>Flush a table of related index column (There is source column in <code class="docutils literal notranslate"><span class="pre">TABLE_NAME</span></code>):</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --target_name TABLE_NAME_OF_INDEX_COLUMN --recursive no
</pre></div>
</div>
</li>
</ul>
<p>To confirm whether all target objects are flushed correctly, you can check query log:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt; io_flush --recursive &quot;dependent&quot; --target_name &quot;Users&quot;
:000000000000000 flush[Users]
:000000000000000 flush[Terms]
:000000000000000 flush[Terms.users_name]
:000000000000000 flush[Users.name]
:000000000000000 flush[(anonymous:table:dat_key)]
:000000000000000 flush[(anonymous:column:var_size)]
:000000000000000 flush[(anonymous:table:hash_key)]
:000000000000000 flush[(anonymous:column:var_size)]
:000000000000000 flush[(DB)]
&lt;000000000000000 rc=0
</pre></div>
</div>
<p>In above example, specified not only <code class="docutils literal notranslate"><span class="pre">Users</span></code> table, related lexicon table <code class="docutils literal notranslate"><span class="pre">Terms</span></code> and
index column <code class="docutils literal notranslate"><span class="pre">Terms.users_name</span></code> (data source is <code class="docutils literal notranslate"><span class="pre">Users.name</span></code>) are also flushed.</p>
<p><code class="docutils literal notranslate"><span class="pre">flush[(anonymous:...)]</span></code> and <code class="docutils literal notranslate"><span class="pre">flush[(DB)]</span></code> means that Groonga’s internal objects
are also flushed.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Log</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">flush[(anonymous:table:dat_key)]</span></code></p></td>
<td><p>The internal object names in DB are flushed. If <code class="docutils literal notranslate"><span class="pre">GRN_DB_KEY=pat</span></code> is set, <code class="docutils literal notranslate"><span class="pre">TABLE_PAT_KEY</span></code> is used instead.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">flush[(anonymous:column:var_size)]</span></code> (logged as first <code class="docutils literal notranslate"><span class="pre">(anonymous:column:var_size)</span></code> object)</p></td>
<td><p>The internal object metadata (builtin types, token filter and so on) are flushed.</p>
<p>This is a variable sized column which stores the above internal object metadata.</p>
</td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">flush[(anonymous:table:hash_key)]</span></code></p></td>
<td><p>The internal configuration objects (which is set by <code class="docutils literal notranslate"><span class="pre">config_set</span></code>) are flushed.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">flush[(anonymous:column:var_size)]</span></code> (logged as second <code class="docutils literal notranslate"><span class="pre">(anonymous:column:var_size)</span></code> object)</p></td>
<td><p>The internal object metadata (options about internal objects such as specified tokenizer options) are flushed.</p>
<p>This is a variable sized column which stores the above internal object metadata.</p>
</td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">flush[(DB)]</span></code></p></td>
<td><p>The DB changes (lock acquired during <code class="docutils literal notranslate"><span class="pre">io_flush</span></code>) are flushed.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="only-opened">
<span id="io-flush-only-opened"></span><h4><span class="section-number">7.3.24.4.2.3. </span><code class="docutils literal notranslate"><span class="pre">only_opened</span></code><a class="headerlink" href="#only-opened" title="Permalink to this headline">¶</a></h4>
<div class="versionadded">
<p><span class="versionmodified added">New in version 7.0.4.</span></p>
</div>
<p>Specifies whether opened objects are only flushed.</p>
<p>If there is only one process that changes the target database, flush
performance will be improved by specifying <code class="docutils literal notranslate"><span class="pre">yes</span></code> to
<code class="docutils literal notranslate"><span class="pre">only_opened</span></code>. It skips needless flushes.</p>
<p>You can’t specify <a class="reference internal" href="#io-flush-target-name"><span class="std std-ref">target_name</span></a> with <code class="docutils literal notranslate"><span class="pre">only_opened</span></code>
option. If you specify <a class="reference internal" href="#io-flush-target-name"><span class="std std-ref">target_name</span></a>, <code class="docutils literal notranslate"><span class="pre">only_opened</span></code> is
ignored.</p>
<p>If you specify <code class="docutils literal notranslate"><span class="pre">yes</span></code> to <code class="docutils literal notranslate"><span class="pre">only_opened</span></code>, <a class="reference internal" href="#io-flush-recursive"><span class="std std-ref">recursive</span></a>
is ignored.</p>
<p><code class="docutils literal notranslate"><span class="pre">only_opened</span></code> value must be <code class="docutils literal notranslate"><span class="pre">yes</span></code> or <code class="docutils literal notranslate"><span class="pre">no</span></code>. <code class="docutils literal notranslate"><span class="pre">yes</span></code> means that
opened objects are only flushed. <code class="docutils literal notranslate"><span class="pre">no</span></code> means that all target objects
are flushed even they aren’t opened.</p>
<p>The following <code class="docutils literal notranslate"><span class="pre">io_flush</span></code> flushes all changes in database, all tables
and all columns:</p>
<p>Execution example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>io_flush --only_opened yes
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="return-value">
<h2><span class="section-number">7.3.24.5. </span>Return value<a class="headerlink" href="#return-value" title="Permalink to this headline">¶</a></h2>
<p>The command returns <code class="docutils literal notranslate"><span class="pre">true</span></code> as body on success such as:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>[HEADER, true]
</pre></div>
</div>
<p>If the command fails, error details are in <code class="docutils literal notranslate"><span class="pre">HEADER</span></code>.</p>
<p>See <a class="reference internal" href="../command/output_format.html"><span class="doc">Output format</span></a> for <code class="docutils literal notranslate"><span class="pre">HEADER</span></code>.</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="#">7.3.24. <code class="docutils literal notranslate"><span class="pre">io_flush</span></code></a><ul>
<li><a class="reference internal" href="#summary">7.3.24.1. Summary</a></li>
<li><a class="reference internal" href="#syntax">7.3.24.2. Syntax</a></li>
<li><a class="reference internal" href="#usage">7.3.24.3. Usage</a></li>
<li><a class="reference internal" href="#parameters">7.3.24.4. Parameters</a><ul>
<li><a class="reference internal" href="#required-parameters">7.3.24.4.1. Required parameters</a></li>
<li><a class="reference internal" href="#optional-parameters">7.3.24.4.2. Optional parameters</a><ul>
<li><a class="reference internal" href="#target-name">7.3.24.4.2.1. <code class="docutils literal notranslate"><span class="pre">target_name</span></code></a></li>
<li><a class="reference internal" href="#recursive">7.3.24.4.2.2. <code class="docutils literal notranslate"><span class="pre">recursive</span></code></a></li>
<li><a class="reference internal" href="#only-opened">7.3.24.4.2.3. <code class="docutils literal notranslate"><span class="pre">only_opened</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#return-value">7.3.24.5. Return value</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index_column_diff.html"
                        title="previous chapter"><span class="section-number">7.3.23. </span><code class="docutils literal notranslate"><span class="pre">index_column_diff</span></code></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="load.html"
                        title="next chapter"><span class="section-number">7.3.25. </span><code class="docutils literal notranslate"><span class="pre">load</span></code></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="load.html" title="7.3.25. load"
             >next</a> |</li>
        <li class="right" >
          <a href="index_column_diff.html" title="7.3.23. index_column_diff"
             >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="../../reference.html" ><span class="section-number">7. </span>Reference manual</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../command.html" ><span class="section-number">7.3. </span>Command</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><span class="section-number">7.3.24. </span><code class="docutils literal notranslate"><span class="pre">io_flush</span></code></a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2009-2021, Brazil, Inc.
    </div>
  </body>
</html>