File: object_inspect.rst

package info (click to toggle)
groonga 15.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 163,080 kB
  • sloc: ansic: 770,564; cpp: 48,925; ruby: 40,447; javascript: 10,250; yacc: 7,045; sh: 5,602; python: 2,821; makefile: 1,672
file content (1135 lines) | stat: -rw-r--r-- 28,871 bytes parent folder | download | duplicates (3)
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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
.. -*- rst -*-

.. groonga-command
.. database: commands_object_inspect

``object_inspect``
==================

Summary
-------

.. versionadded:: 6.0.0

``object_inspect`` inspects an object. You can confirm details of an
object.

For example:

* If the object is a table, you can confirm the number of records in
  the table.

* If the object is a column, you can confirm the type of value of
  the column.

Syntax
------

This command takes only one optional parameter::

  object_inspect [name=null]

Usage
-----

You can inspect an object in the database specified by ``name``:

.. groonga-command
.. include:: ../../example/reference/commands/object_inspect/usage-name.log
.. table_create Users TABLE_HASH_KEY ShortText
.. load --table Users
.. [
.. {"_key": "Alice"}
.. ]
.. object_inspect Users

The ``object_inspect Users`` returns the following information:

* The name of the table: ``"name": Users``

* The total used key size: ``"key": {"total_size": 5}``
  (``"Alice"`` is 5 byte data)

* The maximum total key size: ``"key": {"max_total_size": 4294967295}``

* and so on.

You can inspect the database by not specifying ``name``:

.. groonga-command
.. include:: ../../example/reference/commands/object_inspect/usage-database.log
.. object_inspect

The ``object_inspect`` returns the following information:

* The table type for object name management:
  ``"key": {"type": {"name": "table:dat_key"}}``

* and so on.

Parameters
----------

This section describes all parameters.

Required parameters
^^^^^^^^^^^^^^^^^^^

There is no required parameter.

Optional parameters
^^^^^^^^^^^^^^^^^^^

There is only one optional parameter.

.. _object-inspect-name:

``name``
""""""""

Specifies the object name to be inspected.

If ``name`` isn't specified, the database is inspected.

Return value
------------

The command returns an object (nested key and value pairs) that
includes details of the object (such as table) as body::

  [HEADER, object]

See :doc:`/reference/command/output_format` for ``HEADER``.

The format of the details is depends on object type. For example,
table has key information but function doesn't have key information.

.. _object-inspect-return-value-database:

Database
^^^^^^^^

Database inspection returns the following information::

  {
    "type": {
      "id": DATABASE_TYPE_ID,
      "name": DATABASE_TYPE_NAME
    },
    "name_table": DATABASE_NAME_TABLE
  }

.. _object-inspect-return-value-database-type-id:

``DATABASE_TYPE_ID``
""""""""""""""""""""

``DATABASE_TYPE_ID`` is always ``55``.

.. _object-inspect-return-value-database-type-name:

``DATABASE_TYPE_NAME``
""""""""""""""""""""""

``DATABASE_TYPE_NAME`` is always ``"db"``.

.. _object-inspect-return-value-database-name-table:

``DATABASE_NAME_TABLE``
"""""""""""""""""""""""

``DATABASE_NAME_TABLE`` is a table for managing object names in the
database. The table is :ref:`table-pat-key` or
:ref:`table-dat-key`. Normally, it's :ref:`table-dat-key`.

See :ref:`object-inspect-return-value-table` for format details.

.. _object-inspect-return-value-table:

Table
^^^^^

Table inspection returns the following information::

  {
    "id": TABLE_ID,
    "name": TABLE_NAME,
    "type": {
      "id": TABLE_TYPE_ID,
      "name": TABLE_TYPE_NAME
    },
    "key": {
      "type": TABLE_KEY_TYPE,
      "total_size": TABLE_KEY_TOTAL_SIZE
      "max_total_size": TABLE_KEY_MAX_TOTAL_SIZE
    },
    "value": {
      "type": TABLE_VALUE_TYPE,
    },
    "n_records": TABLE_N_RECORDS
  }

There are some exceptions:

  * :ref:`table-no-key` doesn't return key information because it
    doesn't have key.

  * :ref:`table-dat-key` doesn't return value information because it
    doesn't have value.

.. _object-inspect-return-value-table-id:

``TABLE_ID``
""""""""""""

The ID of the inspected table.

.. _object-inspect-return-value-table-name:

``TABLE_NAME``
""""""""""""""

The name of the inspected table.

.. _object-inspect-return-value-table-type-id:

``TABLE_TYPE_ID``
"""""""""""""""""

The type ID of the inspected table.

Here is a list of type IDs:

.. list-table::
   :header-rows: 1

   * - Table type
     - ID
   * - :ref:`table-hash-key`
     - ``48``
   * - :ref:`table-pat-key`
     - ``49``
   * - :ref:`table-dat-key`
     - ``50``
   * - :ref:`table-no-key`
     - ``51``

.. _object-inspect-return-value-table-type-name:

``TABLE_TYPE_NAME``
"""""""""""""""""""

The type name of the inspected table.

Here is a list of type names:

.. list-table::
   :header-rows: 1

   * - Table type
     - Name
   * - :ref:`table-hash-key`
     - ``"table:hash_key"``
   * - :ref:`table-pat-key`
     - ``"table:pat_key"``
   * - :ref:`table-dat-key`
     - ``"table:dat_key"``
   * - :ref:`table-no-key`
     - ``"table:no_key"``

.. _object-inspect-return-value-table-key-type:

``TABLE_KEY_TYPE``
""""""""""""""""""

The type of key of the inspected table.

See :ref:`object-inspect-return-value-type` for format details.

.. _object-inspect-return-value-table-total-key-size:

``TABLE_KEY_TOTAL_SIZE``
""""""""""""""""""""""""

The total key size of the inspected table in bytes.

.. _object-inspect-return-value-table-max-total-key-size:

``TABLE_KEY_MAX_TOTAL_SIZE``
""""""""""""""""""""""""""""

The maximum total key size of the inspected table in bytes.

.. _object-inspect-return-value-table-value-type:

``TABLE_VALUE_TYPE``
""""""""""""""""""""

The type of value of the inspected table.

See :ref:`object-inspect-return-value-type` for format details.

.. _object-inspect-return-value-table-n-records:

``TABLE_N_RECORDS``
"""""""""""""""""""

The number of records of the inspected table.

It's a 64bit unsigned integer value.

.. _object-inspect-return-value-column:

Column
^^^^^^

.. versionadded:: 7.0.2

Scalar column returns the following information::

  {
    "id": COLUMN_ID,
    "name": COLUMN_NAME
    "table": COLUMN_TABLE,
    "full_name": COLUMN_FULL_NAME,
    "type": {
      "name": COLUMN_TYPE_NAME,
      "raw": {
        "id": COLUMN_TYPE_RAW_ID,
        "name": COLUMN_TYPE_RAW_NAME
      }
    },
    "value": {
      "type": COLUMN_VALUE_TYPE,
      "compress": DATA_COLUMN_VALUE_COMPRESS_METHOD,
      "compress_filters": [
        DATA_COLUMN_VALUE_COMPRESS_FILTER,
        ...
      ]
    }
  }

Vector column is similar to scalar column but there are some
differences.

* Vector column has ``value.weight`` key.

* Vector column has ``value.weight_float32`` key.

* Vector column has ``value.weight_bfloat16`` key.

Vector column returns the following information::

  {
    "id": COLUMN_ID,
    "name": COLUMN_NAME
    "table": COLUMN_TABLE,
    "full_name": COLUMN_FULL_NAME,
    "type": {
      "name": COLUMN_TYPE_NAME,
      "raw": {
        "id": COLUMN_TYPE_RAW_ID,
        "name": COLUMN_TYPE_RAW_NAME
      }
    },
    "value": {
      "type": COLUMN_VALUE_TYPE,
      "compress": DATA_COLUMN_VALUE_COMPRESS_METHOD,
      "weight": VECTOR_COLUMN_VALUE_WEIGHT,
      "weight_float32": VECTOR_COLUMN_VALUE_WEIGHT_FLOAT32,
      "weight_bfloat16": VECTOR_COLUMN_VALUE_WEIGHT_BFLOAT16,
      "compress_filters": [
        DATA_COLUMN_VALUE_COMPRESS_FILTER,
        ...
      ]
    }
  }

.. versionadded:: 14.1.0

Generated scalar/vector column is similar to non generated
scalar/vector column but there are some differences.

* Generated column has ``value.generator`` key.

* Generated column has ``sources`` key.

Generated column returns the following information::

  {
    "id": COLUMN_ID,
    "name": COLUMN_NAME
    "table": COLUMN_TABLE,
    "full_name": COLUMN_FULL_NAME,
    "type": {
      "name": COLUMN_TYPE_NAME,
      "raw": {
        "id": COLUMN_TYPE_RAW_ID,
        "name": COLUMN_TYPE_RAW_NAME
      }
    },
    "value": {
      "type": COLUMN_VALUE_TYPE,
      "compress": DATA_COLUMN_VALUE_COMPRESS_METHOD,
      "weight": VECTOR_COLUMN_VALUE_WEIGHT,
      "weight_float32": VECTOR_COLUMN_VALUE_WEIGHT_FLOAT32,
      "weight_bfloat16": VECTOR_COLUMN_VALUE_WEIGHT_BFLOAT16,
      "compress_filters": [
        DATA_COLUMN_VALUE_COMPRESS_FILTER,
        ...
      ]
      "generator": GENERATED_COLUMN_VALUE_GENERATOR
    },
    "sources": [
      {
        "id": GENERATED_COLUMN_SOURCE_ID,
        "name": GENERATED_COLUMN_SOURCE_NAME,
        "table": GENERATED_COLUMN_SOURCE_TABLE,
        "full_name": GENERATED_COLUMN_SOURCE_FULL_NAME
      },
      ...
    ]
  }

Index column is similar to data column but there are some differences.

* Index column doesn't have ``value.compress`` key.

* Index column has ``value.section`` key.

* Index column has ``value.weight`` key.

* Index column has ``value.position`` key.

* Index column has ``value.size`` key.

* Index column has ``value.statistics`` key.

* Index column has ``sources`` key.

Index column returns the following information::

  {
    "id": COLUMN_ID,
    "name": COLUMN_NAME
    "table": COLUMN_TABLE,
    "full_name": COLUMN_FULL_NAME,
    "type": {
      "name": COLUMN_TYPE_NAME,
      "raw": {
        "id": COLUMN_TYPE_RAW_ID,
        "name": COLUMN_TYPE_RAW_NAME
      }
    },
    "value": {
      "type": COLUMN_VALUE_TYPE,
      "section": INDEX_COLUMN_VALUE_SECTION,
      "weight": INDEX_COLUMN_VALUE_WEIGHT,
      "position": INDEX_COLUMN_VALUE_POSITION,
      "size": INDEX_COLUMN_VALUE_SIZE,
      "statistics": {
        "max_section_id": INDEX_COLUMN_VALUE_STATISTICS_MAX_SECTION_ID,
        "n_garbage_segments": INDEX_COLUMN_VALUE_STATISTICS_N_GARBAGE_SEGMENTS,
        "max_array_segment_id": INDEX_COLUMN_VALUE_STATISTICS_MAX_ARRAY_SEGMENT_ID,
        "n_array_segments": INDEX_COLUMN_VALUE_STATISTICS_N_ARRAY_SEGMENTS,
        "max_buffer_segment_id": INDEX_COLUMN_VALUE_STATISTICS_MAX_BUFFER_SEGMENT_ID,
        "n_buffer_segments": INDEX_COLUMN_VALUE_STATISTICS_N_BUFFER_SEGMENTS,
        "max_in_use_physical_segment_id": INDEX_COLUMN_VALUE_STATISTICS_MAX_IN_USE_PHYSICAL_SEGMENT_ID,
        "n_unmanaged_segments": INDEX_COLUMN_VALUE_STATISTICS_N_UNMANAGED_SEGMENTS,
        "total_chunk_size": INDEX_COLUMN_VALUE_STATISTICS_TOTAL_CHUNK_SIZE,
        "max_in_use_chunk_id": INDEX_COLUMN_VALUE_STATISTICS_MAX_IN_USE_CHUNK_ID,
        "n_garbage_chunks": INDEX_COLUMN_VALUE_STATISTICS_N_GARBAGE_CHUNKS
        "next_physical_segment_id": INDEX_COLUMN_VALUE_STATISTICS_NEXT_PHYSICAL_SEGMENT_ID
        "max_n_physical_segments": INDEX_COLUMN_VALUE_STATISTICS_N_PHYSICAL_SEGMENTS
      }
    },
    "sources": [
      {
        "id": INDEX_COLUMN_SOURCE_ID,
        "name": INDEX_COLUMN_SOURCE_NAME,
        "table": INDEX_COLUMN_SOURCE_TABLE,
        "full_name": INDEX_COLUMN_SOURCE_FULL_NAME
      },
      ...
    ]
  }

.. _object-inspect-return-value-column-id:

``COLUMN_ID``
"""""""""""""

The ID of the inspected column.

.. _object-inspect-return-value-column-name:

``COLUMN_NAME``
"""""""""""""""

The name of the inspected column.

It doesn't include table name. It's just only column name.

If you want full column name (``TABLE_NAME.COLUMN_NAME`` style), use
:ref:`object-inspect-return-value-column-full-name` instead.

.. _object-inspect-return-value-column-table:

``COLUMN_TABLE``
""""""""""""""""

The table of the inspected column.

See :ref:`object-inspect-return-value-table` for format details.

.. _object-inspect-return-value-column-full-name:

``COLUMN_FULL_NAME``
""""""""""""""""""""

The full name of the inspected column.

It includes both table name and column name as
``TABLE_NAME.COLUMN_NAME`` format.

If you just want only column name, use
:ref:`object-inspect-return-value-column-name` instead.

.. _object-inspect-return-value-column-type-name:

``COLUMN_TYPE_NAME``
""""""""""""""""""""

The type name of the inspected column.

Here is a list of type names:

.. list-table::
   :header-rows: 1

   * - Column type
     - Name
   * - :doc:`/reference/columns/scalar`
     - ``"scalar"``
   * - :doc:`/reference/columns/vector`
     - ``"vector"``
   * - :doc:`/reference/columns/index`
     - ``"index"``

.. _object-inspect-return-value-column-type-raw-id:

``COLUMN_TYPE_RAW_ID``
""""""""""""""""""""""

The raw type ID of the inspected column.

Here is a list of raw type IDs:

.. list-table::
   :header-rows: 1

   * - Raw column type
     - ID
   * - Fix size column
     - ``64``
   * - Variable size column
     - ``65``
   * - Index column
     - ``72``

.. _object-inspect-return-value-column-type-raw-name:

``COLUMN_TYPE_RAW_NAME``
""""""""""""""""""""""""

The raw type name of the inspected column.

Here is a list of raw type names:

.. list-table::
   :header-rows: 1

   * - Raw column type
     - Name
   * - Fix size column
     - ``"column:fix_size"``
   * - Variable size column
     - ``"column:var_size"``
   * - Index column
     - ``"column:index"``

.. _object-inspect-return-value-column-value-type:

``COLUMN_VALUE_TYPE``
"""""""""""""""""""""

The type of value of the inspected column.

See :ref:`object-inspect-return-value-type` for format details.

.. _object-inspect-return-value-data-column-value-compress-method:

``DATA_COLUMN_VALUE_COMPRESS_METHOD``
"""""""""""""""""""""""""""""""""""""

The compress method of value of the inspected data column.

Here is a list of compress methods:

.. list-table::
   :header-rows: 1

   * - Compress method
     - Value
   * - zlib
     - ``"zlib"``
   * - LZ4
     - ``"lz4"``
   * - Zstandard
     - ``"zstd"``
   * - None
     - ``null``

.. seealso:: :ref:`column-create-flags`

.. _object-inspect-return-value-data-column-value-compress-filter:

``DATA_COLUMN_VALUE_COMPRESS_FILTER``
"""""""""""""""""""""""""""""""""""""

.. versionadded:: 13.0.8

The compress filter name of the inspected data column.

Here is a list of compress filters:

.. list-table::
   :header-rows: 1

   * - Compress filter
     - Value
   * - ``COMPRESS_FILTER_SHUFFLE``
     - ``"shuffle"``
   * - ``COMPRESS_FILTER_BYTE_DELTA``
     - ``"byte_delta"``
   * - ``COMPRESS_FILTER_TRUNCATE_PRECISION_2BYTES``
     - ``"truncate_precision_2bytes"``
   * - ``COMPRESS_FILTER_TRUNCATE_PRECISION_1BYTE``
     - ``"truncate_precision_1byte"``

.. seealso:: :ref:`column-create-flags`

.. _object-inspect-return-value-vector-column-value-weight:

``VECTOR_COLUMN_VALUE_WEIGHT``
""""""""""""""""""""""""""""""

.. versionadded:: 10.0.4

Whether the inspected column is created with ``WITH_WEIGHT`` flag or
not. The value is ``true`` if ``WITH_WEIGHT`` was specified, ``false``
otherwise.

.. seealso:: :ref:`column-create-flags`

.. _object-inspect-return-value-vector-column-value-weight_float32:

``VECTOR_COLUMN_VALUE_WEIGHT_FLOAT32``
""""""""""""""""""""""""""""""""""""""

.. versionadded:: 10.0.4

Whether the inspected column is created with ``WEIGHT_FLOAT32`` flag
or not. The value is ``true`` if ``WEIGHT_FLOAT32`` was specified,
``false`` otherwise.

.. seealso:: :ref:`column-create-flags`

.. _object-inspect-return-value-vector-column-value-weight_bfloat16:

``VECTOR_COLUMN_VALUE_WEIGHT_BFLOAT16``
"""""""""""""""""""""""""""""""""""""""

.. versionadded:: 13.1.0

Whether the inspected column is created with ``WEIGHT_BFLOAT16`` flag
or not. The value is ``true`` if ``WEIGHT_BFLOAT16`` was specified,
``false`` otherwise.

.. seealso:: :ref:`column-create-flags`

.. _object-inspect-return-value-generated-column-value-generator:

``GENERATED_COLUMN_VALUE_GENERATOR``
""""""""""""""""""""""""""""""""""""

.. versionadded:: 14.1.0

The generator expression in :doc:`../grn_expr/script_syntax`.

.. seealso:: :ref:`column-create-generator`

.. _object-inspect-return-value-generated-column-source-id:

``GENERATED_COLUMN_SOURCE_ID``
""""""""""""""""""""""""""""""

The ID of a source column of the inspected generated column.

.. _object-inspect-return-value-generated-column-source-name:

``GENERATED_COLUMN_SOURCE_NAME``
""""""""""""""""""""""""""""""""

The name of a source column of the inspected generated column.

It doesn't include table name. It's just only column name.

If you want full column name (``TABLE_NAME.COLUMN_NAME`` style), use
:ref:`object-inspect-return-value-generated-column-source-full-name`
instead.

.. _object-inspect-return-value-generated-column-source-table:

``GENERATED_COLUMN_SOURCE_TABLE``
"""""""""""""""""""""""""""""""""

The table of a source column of the inspected generated column.

See :ref:`object-inspect-return-value-table` for format details.

.. _object-inspect-return-value-generated-column-source-full-name:

``GENERATED_COLUMN_SOURCE_FULL_NAME``
"""""""""""""""""""""""""""""""""""""

The full name of a source column of the inspected generated column.

It includes both table name and column name as
``TABLE_NAME.COLUMN_NAME`` format.

If you just want only column name, use
:ref:`object-inspect-return-value-generated-column-source-name`
instead.

.. _object-inspect-return-value-index-column-value-section:

``INDEX_COLUMN_VALUE_SECTION``
""""""""""""""""""""""""""""""

Whether the inspected column is created with ``WITH_SECTION`` flag or
not. The value is ``true`` if ``WITH_SECTION`` was specified,
``false`` otherwise.

.. seealso:: :ref:`column-create-flags`

.. _object-inspect-return-value-index-column-value-weight:

``INDEX_COLUMN_VALUE_WEIGHT``
"""""""""""""""""""""""""""""

Whether the inspected column is created with ``WITH_WEIGHT`` flag or
not. The value is ``true`` if ``WITH_WEIGHT`` was specified, ``false``
otherwise.

.. seealso:: :ref:`column-create-flags`

             .. _object-inspect-return-value-index-column-value-position:

``INDEX_COLUMN_VALUE_POSITION``
"""""""""""""""""""""""""""""""

Whether the inspected column is created with ``WITH_POSITION`` flag or
not.  The value is ``true`` if ``WITH_POSITION`` was specified,
``false`` otherwise.

.. seealso:: :ref:`column-create-flags`

.. _object-inspect-return-value-index-column-value-size:

``INDEX_COLUMN_VALUE_SIZE``
"""""""""""""""""""""""""""

The size of the inspected index column. Index size can be specified by
:ref:`column-create-flags`.

Here is a list of index column sizes:

.. list-table::
   :header-rows: 1

   * - Index column size
     - Value
   * - ``INDEX_SMALL``
     - ``"small"``
   * - ``INDEX_MEDIUM``
     - ``"medium"``
   * - ``INDEX_LARGE``
     - ``"large"``
   * - Default
     - ``"normal"``

.. _object-inspect-return-value-index-column-value-statistics-max-section-id:

``INDEX_COLUMN_VALUE_STATISTICS_MAX_SECTION_ID``
""""""""""""""""""""""""""""""""""""""""""""""""

The max section ID in the inspected index column.

It's always ``0`` for index column that is created without
``WITH_SECTION`` flag.

It's ``0`` or larger for index column that is created with
``WITH_SECTION`` flag. It's ``0`` for empty ``WITH_SECTION`` index
column. It's ``1`` or larger for non-empty ``WITH_SECTION`` index
column.

The max value for ``WITH_SECTION`` index column is the number of
source columns.

.. _object-inspect-return-value-index-column-value-statistics-n-garbage-segments:

``INDEX_COLUMN_VALUE_STATISTICS_N_GARBAGE_SEGMENTS``
""""""""""""""""""""""""""""""""""""""""""""""""""""

The number of garbage segments in the inspected index column.

Index column reuses segment (internal allocated space) that is no
longer used. It's called "garbage segment".

The max value is the max number of segments. See
:ref:`object-inspect-return-value-index-column-value-statistics-n-physical-segments`
for the max number of segments.

.. _object-inspect-return-value-index-column-value-statistics-max-array-segment-id:

``INDEX_COLUMN_VALUE_STATISTICS_MAX_ARRAY_SEGMENT_ID``
""""""""""""""""""""""""""""""""""""""""""""""""""""""

The max ID of segment used for "array" in the inspected index column.

"array" is used for managing "buffer".

The max value is the max number of segments. See
:ref:`object-inspect-return-value-index-column-value-statistics-n-physical-segments`
for the max number of segments.

.. _object-inspect-return-value-index-column-value-statistics-n-array-segments:

``INDEX_COLUMN_VALUE_STATISTICS_N_ARRAY_SEGMENTS``
""""""""""""""""""""""""""""""""""""""""""""""""""

The number of segments used for "array" in the inspected index column.

"array" is used for managing "buffer".

The max value is ``the max number of segments - the number of segments
used for "buffer"``. See
:ref:`object-inspect-return-value-index-column-value-statistics-n-physical-segments`
for the max number of segments.

.. _object-inspect-return-value-index-column-value-statistics-max-buffer-segment-id:

``INDEX_COLUMN_VALUE_STATISTICS_MAX_BUFFER_SEGMENT_ID``
"""""""""""""""""""""""""""""""""""""""""""""""""""""""

The max ID of segment used for "buffer" in the inspected index column.

"buffer" is used for storing posting lists.

The max value is the max number of segments. See
:ref:`object-inspect-return-value-index-column-value-statistics-n-physical-segments`
for the max number of segments.

.. _object-inspect-return-value-index-column-value-statistics-n-buffer-segments:

``INDEX_COLUMN_VALUE_STATISTICS_N_BUFFER_SEGMENTS``
"""""""""""""""""""""""""""""""""""""""""""""""""""

The number of segments used for "buffer" in the inspected index column.

"buffer" is used for storing posting lists.

The max value is ``the max number of segments - the number of segments
used for "array"``. See
:ref:`object-inspect-return-value-index-column-value-statistics-n-physical-segments`
for the max number of segments.

.. _object-inspect-return-value-index-column-value-statistics-max-in-use-physical-segment-id:

``INDEX_COLUMN_VALUE_STATISTICS_MAX_IN_USE_PHYSICAL_SEGMENT_ID``
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

The max segment ID in use as "garbage", "array" or "buffer" in the
inspected index column.

The max value is the max number of segments. See
:ref:`object-inspect-return-value-index-column-value-statistics-n-physical-segments`
for the max number of segments.

.. _object-inspect-return-value-index-column-value-statistics-n-unmanaged-segments:

``INDEX_COLUMN_VALUE_STATISTICS_N_UNMANAGED_SEGMENTS``
""""""""""""""""""""""""""""""""""""""""""""""""""""""

The number of unmanaged segments in the inspected index column.

It must be ``0``.

.. _object-inspect-return-value-index-column-value-statistics-total-chunk-size:

``INDEX_COLUMN_VALUE_STATISTICS_TOTAL_CHUNK_SIZE``
""""""""""""""""""""""""""""""""""""""""""""""""""

The total "chunk" size in the inspected index column.

"chunk" is used for storing posting lists. "buffer" is mutable but
"chunk" is immutable. "chunk" is more space effective than
"buffer". "buffer" is more update effective than "chunk".

Small posting lists are stored into "buffer". Posting lists in
"buffer" are moved to "chunk" when these posting lists are grew.

The max value is ``the max size of a chunk * the max number of
chunks``. But you will not be able to use all spaces because there are
overheads.

The max size of a chunk is ``2 ** 22`` bytes (4MiB). The max
number of chunks depend on index size:

.. list-table::
   :header-rows: 1

   * - Index column size
     - The max number of chunks
   * - ``INDEX_SMALL``
     - ``2**10`` (1024)
   * - ``INDEX_MEDIUM``
     - ``2**14`` (16384)
   * - Default
     - ``2**18`` (262144)

.. _object-inspect-return-value-index-column-value-statistics-max-in-use-chunk-id:

``INDEX_COLUMN_VALUE_STATISTICS_MAX_IN_USE_CHUNK_ID``
"""""""""""""""""""""""""""""""""""""""""""""""""""""

The max "chunk" ID in use in the inspected index column.

The max value is the max number of chunks. See
:ref:`object-inspect-return-value-index-column-value-statistics-total-chunk-size`
for the max number of chunks.

.. _object-inspect-return-value-index-column-value-statistics-n-garbage-chunks:

``INDEX_COLUMN_VALUE_STATISTICS_N_GARBAGE_CHUNKS``
""""""""""""""""""""""""""""""""""""""""""""""""""

The array of the number of garbage "chunks" in the inspected index
column.

Garbage "chunks" are managed by separated 14 spaces. It shows all the
number of garbage "chunks" as an array like the following::

  [
    N_GARBAGE_CHUNKS_IN_SPACE0,
    N_GARBAGE_CHUNKS_IN_SPACE1,
    ...
    N_GARBAGE_CHUNKS_IN_SPACE13
  ]

The max value of each space is the max number of chunks. See
:ref:`object-inspect-return-value-index-column-value-statistics-total-chunk-size`
for the max number of chunks.

.. _object-inspect-return-value-index-column-value-statistics-next-physical-segment-id:

``INDEX_COLUMN_VALUE_STATISTICS_NEXT_PHYSICAL_SEGMENT_ID``
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

.. versionadded:: 9.0.2

This value is the ID of the segment. The inspected index column use it as the next segment ID.
The max value is the max number of segments. See
:ref:`object-inspect-return-value-index-column-value-statistics-n-physical-segments`
for the max number of segments.

.. _object-inspect-return-value-index-column-value-statistics-n-physical-segments:

``INDEX_COLUMN_VALUE_STATISTICS_N_PHYSICAL_SEGMENTS``
"""""""""""""""""""""""""""""""""""""""""""""""""""""

.. versionadded:: 9.0.2

This value the max number of segments. It depends on index size:

.. list-table::
   :header-rows: 1

   * - Index column size
     - The max number of segments
   * - ``INDEX_SMALL``
     - ``2**9`` (512)
   * - ``INDEX_MEDIUM``
     - ``2**16`` (65536)
   * - ``INDEX_LARGE``
     - ``2**17 * 2`` (262144)
   * - Default
     - ``2**17`` (131072)

If the number of segments tend to exceeds near the future, you need to consider to adopt ``INDEX_XXX`` flags.

.. _object-inspect-return-value-index-column-source-id:

``INDEX_COLUMN_SOURCE_ID``
""""""""""""""""""""""""""

The ID of a source column of the inspected index column.

.. _object-inspect-return-value-index-column-source-name:

``INDEX_COLUMN_SOURCE_NAME``
""""""""""""""""""""""""""""

The name of a source column of the inspected index column.

It doesn't include table name. It's just only column name.

If you want full column name (``TABLE_NAME.COLUMN_NAME`` style), use
:ref:`object-inspect-return-value-index-column-source-full-name`
instead.

.. _object-inspect-return-value-index-column-source-table:

``INDEX_COLUMN_SOURCE_TABLE``
"""""""""""""""""""""""""""""

The table of a source column of the inspected index column.

See :ref:`object-inspect-return-value-table` for format details.

.. _object-inspect-return-value-index-column-source-full-name:

``INDEX_COLUMN_SOURCE_FULL_NAME``
"""""""""""""""""""""""""""""""""

The full name of a source column of the inspected index column.

It includes both table name and column name as
``TABLE_NAME.COLUMN_NAME`` format.

If you just want only column name, use
:ref:`object-inspect-return-value-index-column-source-name` instead.


.. _object-inspect-return-value-type:

Type
""""

Type inspection returns the following information::

  {
    "id": TYPE_ID,
    "name": TYPE_NAME,
    "type": {
      "id": TYPE_ID_OF_TYPE,
      "name": TYPE_NAME_OF_TYPE
    },
    "size": TYPE_SIZE
  }

.. _object-inspect-return-value-type-id:

``TYPE_ID``
"""""""""""

The ID of the inspected type.

Here is an ID list of builtin types:

.. list-table::
   :header-rows: 1

   * - Type
     - ID
   * - :ref:`builtin-type-bool`
     - ``3``
   * - :ref:`builtin-type-int8`
     - ``4``
   * - :ref:`builtin-type-uint8`
     - ``5``
   * - :ref:`builtin-type-int16`
     - ``6``
   * - :ref:`builtin-type-uint16`
     - ``7``
   * - :ref:`builtin-type-int32`
     - ``8``
   * - :ref:`builtin-type-uint32`
     - ``9``
   * - :ref:`builtin-type-int64`
     - ``10``
   * - :ref:`builtin-type-uint64`
     - ``11``
   * - :ref:`builtin-type-float`
     - ``12``
   * - :ref:`builtin-type-time`
     - ``13``
   * - :ref:`builtin-type-short-text`
     - ``14``
   * - :ref:`builtin-type-text`
     - ``15``
   * - :ref:`builtin-type-long-text`
     - ``16``
   * - :ref:`builtin-type-tokyo-geo-point`
     - ``17``
   * - :ref:`builtin-type-wgs84-geo-point`
     - ``18``

.. _object-inspect-return-value-type-name:

``TYPE_NAME``
"""""""""""""

The name of the inspected type.

Here is a name list of builtin types:

  * :ref:`builtin-type-bool`
  * :ref:`builtin-type-int8`
  * :ref:`builtin-type-uint8`
  * :ref:`builtin-type-int16`
  * :ref:`builtin-type-uint16`
  * :ref:`builtin-type-int32`
  * :ref:`builtin-type-uint32`
  * :ref:`builtin-type-int64`
  * :ref:`builtin-type-uint64`
  * :ref:`builtin-type-float`
  * :ref:`builtin-type-time`
  * :ref:`builtin-type-short-text`
  * :ref:`builtin-type-text`
  * :ref:`builtin-type-long-text`
  * :ref:`builtin-type-tokyo-geo-point`
  * :ref:`builtin-type-wgs84-geo-point`

.. _object-inspect-return-value-type-id-of-type:

``TYPE_ID_OF_TYPE``
"""""""""""""""""""

``TYPE_ID_OF_TYPE`` is always ``32``.

.. _object-inspect-return-value-type-name-of-type:

``TYPE_NAME_OF_TYPE``
"""""""""""""""""""""

``TYPE_NAME_OF_TYPE`` is always ``type``.

.. _object-inspect-return-value-type-size:

``TYPE_SIZE``
"""""""""""""

``TYPE_SIZE`` is the size of the inspected type in bytes. If the
inspected type is variable size type, the size means the maximum size.