From 7bc8f1bd06b04f4d8c3a4cd9a88a071f81e44b16 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov <kostja.osipov@gmail.com> Date: Thu, 19 Jan 2012 20:12:04 +0400 Subject: [PATCH] tree-index-opt: add comments. --- mod/box/box.h | 20 ++++++++++++++++---- mod/box/index.h | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/mod/box/box.h b/mod/box/box.h index f46b7cb857..41582a3c87 100644 --- a/mod/box/box.h +++ b/mod/box/box.h @@ -42,14 +42,26 @@ enum }; struct space { + Index *index[BOX_INDEX_MAX]; int n; - bool enabled; int cardinality; - Index *index[BOX_INDEX_MAX]; - /* inferred data */ + /** + * Inferred data: max field no which participates in an + * index. Each tuple in this space must have, therefore, at + * least indexed_field_count fields. + */ int field_count; - int *field_types; + /** + * Field types of indexed fields. This is an array of size + * indexed_field_count. If there are gaps, i.e. fields + * which do not participate in an index and for which we + * thus can't infer field type, respective array member + * has value UNKNOWN. XXX: right now UNKNOWN is also + * set for fields which types in two indexes contradict. + */ + enum field_data_type *field_types; + bool enabled; }; extern struct space *space; diff --git a/mod/box/index.h b/mod/box/index.h index 45587d3932..ccbeeba4e9 100644 --- a/mod/box/index.h +++ b/mod/box/index.h @@ -131,7 +131,7 @@ struct iterator { void (*free)(struct iterator *); }; -struct box_tuple * iterator_first_equal(struct iterator *it); +struct box_tuple *iterator_first_equal(struct iterator *it); #define foreach_index(n, index_var) \ Index *index_var; \ -- GitLab