PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "lib/integerset.h"
#include "port/pg_bitutils.h"
#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
struct | intset_node |
struct | intset_internal_node |
struct | leaf_item |
struct | intset_leaf_node |
struct | IntegerSet |
struct | simple8b_mode |
Macros | |
#define | SIMPLE8B_MAX_VALUES_PER_CODEWORD 240 |
#define | MAX_INTERNAL_ITEMS 64 |
#define | MAX_LEAF_ITEMS 64 |
#define | MAX_TREE_LEVELS 11 |
#define | MAX_VALUES_PER_LEAF_ITEM (1 + SIMPLE8B_MAX_VALUES_PER_CODEWORD) |
#define | MAX_BUFFERED_VALUES (MAX_VALUES_PER_LEAF_ITEM * 2) |
#define | EMPTY_CODEWORD UINT64CONST(0x0FFFFFFFFFFFFFFF) |
Typedefs | |
typedef struct intset_node | intset_node |
typedef struct intset_leaf_node | intset_leaf_node |
typedef struct intset_internal_node | intset_internal_node |
Variables | |
static const struct simple8b_mode | simple8b_modes [17] |
#define EMPTY_CODEWORD UINT64CONST(0x0FFFFFFFFFFFFFFF) |
Definition at line 857 of file integerset.c.
#define MAX_BUFFERED_VALUES (MAX_VALUES_PER_LEAF_ITEM * 2) |
Definition at line 187 of file integerset.c.
#define MAX_INTERNAL_ITEMS 64 |
Definition at line 95 of file integerset.c.
#define MAX_LEAF_ITEMS 64 |
Definition at line 96 of file integerset.c.
#define MAX_TREE_LEVELS 11 |
Definition at line 110 of file integerset.c.
#define MAX_VALUES_PER_LEAF_ITEM (1 + SIMPLE8B_MAX_VALUES_PER_CODEWORD) |
Definition at line 167 of file integerset.c.
#define SIMPLE8B_MAX_VALUES_PER_CODEWORD 240 |
Definition at line 84 of file integerset.c.
typedef struct intset_internal_node intset_internal_node |
Definition at line 1 of file integerset.c.
typedef struct intset_leaf_node intset_leaf_node |
Definition at line 1 of file integerset.c.
typedef struct intset_node intset_node |
Definition at line 1 of file integerset.c.
void intset_add_member | ( | IntegerSet * | intset, |
uint64 | x | ||
) |
Definition at line 370 of file integerset.c.
References Assert, elog, ERROR, intset(), intset_flush_buffered_values(), MAX_BUFFERED_VALUES, and x.
Referenced by gistvacuumpage(), test_huge_distances(), test_pattern(), test_single_value(), and test_single_value_and_filler().
void intset_begin_iterate | ( | IntegerSet * | intset | ) |
Definition at line 624 of file integerset.c.
References intset().
Referenced by gistvacuum_delete_empty_pages(), test_empty(), test_huge_distances(), test_pattern(), test_single_value(), and test_single_value_and_filler().
|
static |
IntegerSet* intset_create | ( | void | ) |
Definition at line 284 of file integerset.c.
References CurrentMemoryContext, GetMemoryChunkSpace(), intset(), and palloc().
Referenced by gistvacuumscan(), test_empty(), test_huge_distances(), test_pattern(), test_single_value(), and test_single_value_and_filler().
|
static |
Definition at line 396 of file integerset.c.
References leaf_item::codeword, leaf_item::first, if(), intset(), intset_new_leaf_node(), intset_update_upper(), intset_leaf_node::items, MAX_LEAF_ITEMS, MAX_VALUES_PER_LEAF_ITEM, intset_leaf_node::next, intset_leaf_node::num_items, simple8b_encode(), and values.
Referenced by intset_add_member().
bool intset_is_member | ( | IntegerSet * | intset, |
uint64 | x | ||
) |
Definition at line 554 of file integerset.c.
References Assert, leaf_item::codeword, intset_internal_node::downlinks, leaf_item::first, intset(), intset_binsrch_leaf(), intset_binsrch_uint64(), intset_leaf_node::items, intset_node::level, intset_internal_node::num_items, intset_leaf_node::num_items, simple8b_contains(), intset_internal_node::values, and x.
Referenced by check_with_filler(), gistvacuum_delete_empty_pages(), test_empty(), test_huge_distances(), test_pattern(), and test_single_value().
bool intset_iterate_next | ( | IntegerSet * | intset, |
uint64 * | next | ||
) |
Definition at line 643 of file integerset.c.
References Assert, leaf_item::codeword, leaf_item::first, intset(), next, and simple8b_decode().
Referenced by gistvacuum_delete_empty_pages(), test_empty(), test_huge_distances(), test_pattern(), test_single_value(), and test_single_value_and_filler().
uint64 intset_memory_usage | ( | IntegerSet * | intset | ) |
Definition at line 359 of file integerset.c.
References intset().
Referenced by test_pattern(), and test_single_value_and_filler().
|
static |
Definition at line 316 of file integerset.c.
References GetMemoryChunkSpace(), intset(), intset_internal_node::level, MemoryContextAlloc(), and intset_internal_node::num_items.
Referenced by intset_update_upper().
|
static |
Definition at line 331 of file integerset.c.
References GetMemoryChunkSpace(), intset(), intset_leaf_node::level, MemoryContextAlloc(), intset_leaf_node::next, and intset_leaf_node::num_items.
Referenced by intset_flush_buffered_values().
uint64 intset_num_entries | ( | IntegerSet * | intset | ) |
Definition at line 350 of file integerset.c.
References intset().
Referenced by gistvacuum_delete_empty_pages(), test_pattern(), test_single_value(), and test_single_value_and_filler().
|
static |
Definition at line 481 of file integerset.c.
References Assert, intset_internal_node::downlinks, elog, ERROR, if(), intset(), intset_new_internal_node(), intset_internal_node::level, MAX_INTERNAL_ITEMS, MAX_TREE_LEVELS, intset_internal_node::num_items, and intset_internal_node::values.
Referenced by intset_flush_buffered_values().
|
static |
Definition at line 1004 of file integerset.c.
References simple8b_mode::bits_per_int, EMPTY_CODEWORD, i, sort-test::key, simple8b_mode::num_ints, and simple8b_modes.
Referenced by intset_is_member().
|
static |
Definition at line 975 of file integerset.c.
References simple8b_mode::bits_per_int, EMPTY_CODEWORD, i, simple8b_mode::num_ints, and simple8b_modes.
Referenced by intset_iterate_next().
|
static |
Definition at line 873 of file integerset.c.
References Assert, simple8b_mode::bits_per_int, EMPTY_CODEWORD, i, simple8b_mode::num_ints, and simple8b_modes.
Referenced by intset_flush_buffered_values().
|
static |
Referenced by simple8b_contains(), simple8b_decode(), and simple8b_encode().