duckdb 0.8.2-dev1764.0 → 0.8.2-dev1859.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/binding.gyp +1 -0
- package/package.json +1 -1
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +1 -0
- package/src/duckdb/extension/parquet/parquet_extension.cpp +38 -22
- package/src/duckdb/extension/parquet/parquet_reader.cpp +1 -4
- package/src/duckdb/src/common/constants.cpp +2 -1
- package/src/duckdb/src/common/enum_util.cpp +5 -5
- package/src/duckdb/src/common/sort/sort_state.cpp +1 -1
- package/src/duckdb/src/common/sort/sorted_block.cpp +1 -1
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +8 -0
- package/src/duckdb/src/common/types/column/column_data_collection_segment.cpp +5 -0
- package/src/duckdb/src/common/types/string_heap.cpp +4 -0
- package/src/duckdb/src/core_functions/function_list.cpp +2 -0
- package/src/duckdb/src/core_functions/scalar/debug/vector_type.cpp +23 -0
- package/src/duckdb/src/execution/index/art/art.cpp +49 -108
- package/src/duckdb/src/execution/index/art/art_key.cpp +0 -11
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +10 -14
- package/src/duckdb/src/execution/index/art/iterator.cpp +13 -19
- package/src/duckdb/src/execution/index/art/leaf.cpp +290 -241
- package/src/duckdb/src/execution/index/art/node.cpp +104 -95
- package/src/duckdb/src/execution/index/art/node16.cpp +6 -6
- package/src/duckdb/src/execution/index/art/node256.cpp +6 -6
- package/src/duckdb/src/execution/index/art/node4.cpp +6 -6
- package/src/duckdb/src/execution/index/art/node48.cpp +6 -6
- package/src/duckdb/src/execution/index/art/prefix.cpp +49 -39
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +34 -1175
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +4 -14
- package/src/duckdb/src/execution/window_executor.cpp +1280 -0
- package/src/duckdb/src/execution/window_segment_tree.cpp +224 -117
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/type_util.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/typedefs.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_allocator.hpp +10 -0
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection_segment.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/types/string_heap.hpp +3 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/debug_functions.hpp +27 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +0 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +22 -24
- package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +43 -40
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +119 -40
- package/src/duckdb/src/include/duckdb/execution/index/art/node16.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node4.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/window_executor.hpp +313 -0
- package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +60 -53
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +1 -0
- package/src/duckdb/src/parser/parser.cpp +43 -38
- package/src/duckdb/src/storage/arena_allocator.cpp +12 -0
- package/src/duckdb/src/storage/compression/rle.cpp +52 -12
- package/src/duckdb/ub_src_core_functions_scalar_debug.cpp +2 -0
- package/src/duckdb/ub_src_execution.cpp +2 -0
- package/src/duckdb/ub_src_execution_index_art.cpp +0 -4
- package/src/duckdb/src/execution/index/art/leaf_segment.cpp +0 -52
- package/src/duckdb/src/execution/index/art/swizzleable_pointer.cpp +0 -22
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +0 -38
- package/src/duckdb/src/include/duckdb/execution/index/art/swizzleable_pointer.hpp +0 -58
@@ -1,9 +1,5 @@
|
|
1
1
|
#include "duckdb/execution/index/art/fixed_size_allocator.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/common/allocator.hpp"
|
4
|
-
#include "duckdb/common/exception.hpp"
|
5
|
-
#include "duckdb/common/helper.hpp"
|
6
|
-
|
7
3
|
namespace duckdb {
|
8
4
|
|
9
5
|
constexpr idx_t FixedSizeAllocator::BASE[];
|
@@ -46,7 +42,7 @@ FixedSizeAllocator::~FixedSizeAllocator() {
|
|
46
42
|
}
|
47
43
|
}
|
48
44
|
|
49
|
-
|
45
|
+
Node FixedSizeAllocator::New() {
|
50
46
|
|
51
47
|
// no more free pointers
|
52
48
|
if (buffers_with_free_space.empty()) {
|
@@ -77,19 +73,19 @@ SwizzleablePointer FixedSizeAllocator::New() {
|
|
77
73
|
buffers_with_free_space.erase(buffer_id);
|
78
74
|
}
|
79
75
|
|
80
|
-
return
|
76
|
+
return Node(buffer_id, offset);
|
81
77
|
}
|
82
78
|
|
83
|
-
void FixedSizeAllocator::Free(const
|
84
|
-
auto bitmask_ptr = reinterpret_cast<validity_t *>(buffers[ptr.
|
79
|
+
void FixedSizeAllocator::Free(const Node ptr) {
|
80
|
+
auto bitmask_ptr = reinterpret_cast<validity_t *>(buffers[ptr.GetBufferId()].ptr);
|
85
81
|
ValidityMask mask(bitmask_ptr);
|
86
|
-
D_ASSERT(!mask.RowIsValid(ptr.
|
87
|
-
mask.SetValid(ptr.
|
88
|
-
buffers_with_free_space.insert(ptr.
|
82
|
+
D_ASSERT(!mask.RowIsValid(ptr.GetOffset()));
|
83
|
+
mask.SetValid(ptr.GetOffset());
|
84
|
+
buffers_with_free_space.insert(ptr.GetBufferId());
|
89
85
|
|
90
86
|
D_ASSERT(total_allocations > 0);
|
91
|
-
D_ASSERT(buffers[ptr.
|
92
|
-
buffers[ptr.
|
87
|
+
D_ASSERT(buffers[ptr.GetBufferId()].allocation_count > 0);
|
88
|
+
buffers[ptr.GetBufferId()].allocation_count--;
|
93
89
|
total_allocations--;
|
94
90
|
}
|
95
91
|
|
@@ -172,7 +168,7 @@ void FixedSizeAllocator::FinalizeVacuum() {
|
|
172
168
|
}
|
173
169
|
}
|
174
170
|
|
175
|
-
|
171
|
+
Node FixedSizeAllocator::VacuumPointer(const Node ptr) {
|
176
172
|
|
177
173
|
// we do not need to adjust the bitmask of the old buffer, because we will free the entire
|
178
174
|
// buffer after the vacuum operation
|
@@ -58,17 +58,11 @@ bool Iterator::Scan(const ARTKey &upper_bound, const idx_t max_count, vector<row
|
|
58
58
|
}
|
59
59
|
}
|
60
60
|
|
61
|
-
//
|
62
|
-
if (
|
61
|
+
// copy all row IDs of this leaf into the result IDs (if they don't exceed max_count)
|
62
|
+
if (!Leaf::GetRowIds(*art, last_leaf, result_ids, max_count)) {
|
63
63
|
return false;
|
64
64
|
}
|
65
65
|
|
66
|
-
// FIXME: copy all at once to improve performance
|
67
|
-
for (idx_t i = 0; i < last_leaf->count; i++) {
|
68
|
-
row_t row_id = last_leaf->GetRowId(*art, i);
|
69
|
-
result_ids.push_back(row_id);
|
70
|
-
}
|
71
|
-
|
72
66
|
// get the next leaf
|
73
67
|
has_next = Next();
|
74
68
|
|
@@ -80,18 +74,18 @@ bool Iterator::Scan(const ARTKey &upper_bound, const idx_t max_count, vector<row
|
|
80
74
|
void Iterator::FindMinimum(Node &node) {
|
81
75
|
|
82
76
|
D_ASSERT(node.IsSet());
|
83
|
-
if (node.
|
77
|
+
if (node.IsSerialized()) {
|
84
78
|
node.Deserialize(*art);
|
85
79
|
}
|
86
80
|
|
87
81
|
// found the minimum
|
88
|
-
if (node.
|
89
|
-
last_leaf =
|
82
|
+
if (node.GetType() == NType::LEAF || node.GetType() == NType::LEAF_INLINED) {
|
83
|
+
last_leaf = node;
|
90
84
|
return;
|
91
85
|
}
|
92
86
|
|
93
87
|
// traverse the prefix
|
94
|
-
if (node.
|
88
|
+
if (node.GetType() == NType::PREFIX) {
|
95
89
|
auto &prefix = Prefix::Get(*art, node);
|
96
90
|
for (idx_t i = 0; i < prefix.data[Node::PREFIX_SIZE]; i++) {
|
97
91
|
current_key.Push(prefix.data[i]);
|
@@ -115,20 +109,20 @@ bool Iterator::LowerBound(Node &node, const ARTKey &key, const bool equal, idx_t
|
|
115
109
|
return false;
|
116
110
|
}
|
117
111
|
|
118
|
-
if (node.
|
112
|
+
if (node.IsSerialized()) {
|
119
113
|
node.Deserialize(*art);
|
120
114
|
}
|
121
115
|
|
122
116
|
// we found the lower bound
|
123
|
-
if (node.
|
117
|
+
if (node.GetType() == NType::LEAF || node.GetType() == NType::LEAF_INLINED) {
|
124
118
|
if (!equal && current_key == key) {
|
125
119
|
return Next();
|
126
120
|
}
|
127
|
-
last_leaf =
|
121
|
+
last_leaf = node;
|
128
122
|
return true;
|
129
123
|
}
|
130
124
|
|
131
|
-
if (node.
|
125
|
+
if (node.GetType() != NType::PREFIX) {
|
132
126
|
auto next_byte = key[depth];
|
133
127
|
auto child = node.GetNextChild(*art, next_byte);
|
134
128
|
if (!child) {
|
@@ -181,9 +175,9 @@ bool Iterator::Next() {
|
|
181
175
|
while (!nodes.empty()) {
|
182
176
|
|
183
177
|
auto &top = nodes.top();
|
184
|
-
D_ASSERT(top.node.
|
178
|
+
D_ASSERT(top.node.GetType() != NType::LEAF && top.node.GetType() != NType::LEAF_INLINED);
|
185
179
|
|
186
|
-
if (top.node.
|
180
|
+
if (top.node.GetType() == NType::PREFIX) {
|
187
181
|
PopNode();
|
188
182
|
continue;
|
189
183
|
}
|
@@ -211,7 +205,7 @@ bool Iterator::Next() {
|
|
211
205
|
}
|
212
206
|
|
213
207
|
void Iterator::PopNode() {
|
214
|
-
if (nodes.top().node.
|
208
|
+
if (nodes.top().node.GetType() == NType::PREFIX) {
|
215
209
|
auto prefix_byte_count = Prefix::Get(*art, nodes.top().node).data[Node::PREFIX_SIZE];
|
216
210
|
current_key.Pop(prefix_byte_count);
|
217
211
|
} else {
|