Commit 8588cf8
committed
perf(join): eliminate JSON decode from join execution pipeline
Hash, nested-loop, and sort-merge join handlers previously decoded
msgpack rows to serde_json::Value for merging, filtering, and
projection, then re-encoded back to msgpack before sending the
response. This introduced two redundant serialize/deserialize
roundtrips per joined row.
Replace the JSON-based path with an end-to-end binary msgpack
pipeline:
- merge_join_docs_binary now writes a prefixed msgpack map directly
without decoding values, copying value bytes verbatim from the
source buffers.
- probe_hash_index returns Vec<Vec<u8>> (binary rows) instead of
Vec<serde_json::Value>.
- Post-join filters evaluate against binary rows using
binary_row_matches_filters, with suffix-matching to handle
qualified keys (e.g. "orders.amount") against unqualified filter
fields ("amount").
- Post-join projection uses binary_row_project, scanning the map
once and writing only selected fields to a new buffer.
- All three join types encode results with encode_binary_rows, which
concatenates pre-built row buffers under a msgpack array header
with zero decoding.
- Extract write_str (msgpack string encoding) to a shared
msgpack_utils module consumed by both response_codec and the join
handlers.
- Propagate projection and post_filters through the PhysicalPlan
broadcast join variant and the dispatch path so the Data Plane
can apply them without a Control Plane roundtrip.1 parent 0011a6f commit 8588cf8
10 files changed
Lines changed: 258 additions & 118 deletions
File tree
- nodedb/src
- bridge/physical_plan
- control/server/pgwire/handler
- data/executor
- dispatch
- handlers/join
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| 124 | + | |
| 125 | + | |
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| 170 | + | |
| 171 | + | |
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
262 | | - | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 266 | + | |
276 | 267 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 268 | + | |
285 | 269 | | |
286 | 270 | | |
287 | 271 | | |
288 | | - | |
289 | | - | |
| 272 | + | |
| 273 | + | |
290 | 274 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 275 | + | |
300 | 276 | | |
301 | 277 | | |
302 | 278 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
| 279 | + | |
| 280 | + | |
312 | 281 | | |
313 | 282 | | |
314 | 283 | | |
| |||
326 | 295 | | |
327 | 296 | | |
328 | 297 | | |
| 298 | + | |
| 299 | + | |
329 | 300 | | |
330 | 301 | | |
331 | 302 | | |
| |||
372 | 343 | | |
373 | 344 | | |
374 | 345 | | |
375 | | - | |
| 346 | + | |
376 | 347 | | |
377 | 348 | | |
378 | 349 | | |
| |||
383 | 354 | | |
384 | 355 | | |
385 | 356 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
394 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
395 | 375 | | |
396 | 376 | | |
0 commit comments