HashAggregate (cost=37101.37..37241.48 rows=14011 width=51) (actual time=1063.068..1116.203 rows=50000 loops=1) |
Group Key: "values".value_id, "values".name, (string_agg((jsonb_path_query_first(("values".value)::jsonb, ((('$['::text || ((complex_cond.num - 1))::text) || ']'::text))::jsonpath, '{}'::jsonb, false))::text, '_'::text) OVER (?)) |
Batches: 5 Memory Usage: 4145kB Disk Usage: 7728kB |
-> Unique (cost=1.92..34649.41 rows=140112 width=64) (actual time=3.441..924.772 rows=260000 loops=1) |
-> WindowAgg (cost=1.92..32691.07 rows=261113 width=64) (actual time=3.438..852.363 rows=280000 loops=1) |
-> Incremental Sort (cost=1.92..18982.63 rows=261113 width=76) (actual time=0.105..290.287 rows=280000 loops=1) |
Sort Key: "values".name, "values".value_id, complex_in.complex_id |
Presorted Key: "values".name, "values".value_id |
Full-sort Groups: 7917 Sort Method: quicksort Average Memory: 32kB Peak Memory: 32kB |
-> Merge Join (cost=1.63..8578.21 rows=261113 width=76) (actual time=0.057..102.297 rows=280000 loops=1) |
Merge Cond: (("values".name)::text = (complex_in.input)::text) |
-> Index Scan using values_pkey on "values" (cost=0.41..4521.22 rows=50000 width=55) (actual time=0.011..29.658 rows=50000 loops=1) |
-> Materialize (cost=1.22..15.36 rows=26 width=26) (actual time=0.041..15.844 rows=270001 loops=1) |
-> Nested Loop Left Join (cost=1.22..15.30 rows=26 width=26) (actual time=0.039..0.100 rows=28 loops=1) |
Join Filter: ((complex_cond.complex_id)::text = (complex_in.complex_id)::text) |
Rows Removed by Join Filter: 100 |
-> Index Only Scan using complex_in_pkey on complex_in (cost=0.14..12.53 rows=26 width=18) (actual time=0.003..0.028 rows=26 loops=1) |
Heap Fetches: 26 |
-> Materialize (cost=1.08..1.22 rows=4 width=25) (actual time=0.001..0.002 rows=4 loops=26) |
-> Subquery Scan on complex_cond (cost=1.08..1.20 rows=4 width=25) (actual time=0.032..0.038 rows=4 loops=1) |
-> WindowAgg (cost=1.08..1.16 rows=4 width=30) (actual time=0.032..0.036 rows=4 loops=1) |
-> Sort (cost=1.08..1.09 rows=4 width=22) (actual time=0.018..0.020 rows=4 loops=1) |
Sort Key: complex_groupcond.complex_id, complex_groupcond.cond |
Sort Method: quicksort Memory: 25kB |
-> Seq Scan on complex_groupcond (cost=0.00..1.04 rows=4 width=22) (actual time=0.009..0.010 rows=4 loops=1) |
Planning Time: 1.025 ms |
Execution Time: 1119.345 ms |