aboutsummaryrefslogtreecommitdiff
path: root/content/posts/nested-postgres-results/jsonb-array-agg.txt
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-09-07 21:35:50 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-09-07 21:35:50 +0200
commit07871783082839a768e4fa999cee58532d0a79fe (patch)
tree646f8b3be966e087dbdc6341c26d5fcddee89254 /content/posts/nested-postgres-results/jsonb-array-agg.txt
parente083b5a37932ecf18efc73019a3fdb90e242cd7c (diff)
draft for nested postgres results
Diffstat (limited to 'content/posts/nested-postgres-results/jsonb-array-agg.txt')
-rw-r--r--content/posts/nested-postgres-results/jsonb-array-agg.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/content/posts/nested-postgres-results/jsonb-array-agg.txt b/content/posts/nested-postgres-results/jsonb-array-agg.txt
new file mode 100644
index 0000000..35ae6bb
--- /dev/null
+++ b/content/posts/nested-postgres-results/jsonb-array-agg.txt
@@ -0,0 +1,33 @@
+ GroupAggregate (cost=14173.77..16807.65 rows=8725 width=36) (actual time=15.671..34.981 rows=10000 loops=1)
+ Output: accommodation_id, jsonb_agg(jsonb_build_object('date', date, 'price', price))
+ Group Key: overrides.accommodation_id
+ Buffers: shared hit=6442
+ -> Gather Merge (cost=14173.77..16545.84 rows=20367 width=13) (actual time=15.641..17.253 rows=20000 loops=1)
+ Output: accommodation_id, date, price
+ Workers Planned: 2
+ Workers Launched: 2
+ Buffers: shared hit=6442
+ -> Sort (cost=13173.74..13194.96 rows=8486 width=13) (actual time=13.876..14.122 rows=6667 loops=3)
+ Output: accommodation_id, date, price
+ Sort Key: overrides.accommodation_id
+ Sort Method: quicksort Memory: 430kB
+ Buffers: shared hit=6442
+ Worker 0: actual time=13.239..13.513 rows=6391 loops=1
+ Sort Method: quicksort Memory: 392kB
+ Buffers: shared hit=2067
+ Worker 1: actual time=13.028..13.281 rows=5997 loops=1
+ Sort Method: quicksort Memory: 380kB
+ Buffers: shared hit=1948
+ -> Parallel Seq Scan on public.overrides (cost=0.00..12619.99 rows=8486 width=13) (actual time=0.009..13.186 rows=6667 loops=3)
+ Output: accommodation_id, date, price
+ Filter: ((overrides.date >= '2025-07-01'::date) AND (overrides.date < '2025-07-08'::date))
+ Rows Removed by Filter: 326666
+ Buffers: shared hit=6370
+ Worker 0: actual time=0.010..12.581 rows=6391 loops=1
+ Buffers: shared hit=2031
+ Worker 1: actual time=0.008..12.365 rows=5997 loops=1
+ Buffers: shared hit=1912
+ Planning:
+ Buffers: shared hit=129
+ Planning Time: 0.251 ms
+ Execution Time: 35.310 ms