Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Views only, no functions - dbfiddle: https://dbfiddle.uk/?rdbms=postgres_13&fiddle=2cb60f2675eae120cfc5552017f1de90
- QUERY PLAN
- --------------------------------------------------------------------------------------------------------------------------------------------------------------
- Result (cost=303629.51..303629.53 rows=1 width=32) (actual time=1572.903..1574.726 rows=1 loops=1)
- Buffers: shared hit=27683 read=109487 written=79
- InitPlan 1 (returns $1)
- -> Finalize Aggregate (cost=97331.80..97331.81 rows=1 width=8) (actual time=527.776..527.858 rows=1 loops=1)
- Buffers: shared hit=129 read=44119
- -> Gather (cost=97331.58..97331.79 rows=2 width=8) (actual time=527.708..527.852 rows=3 loops=1)
- Workers Planned: 2
- Workers Launched: 2
- Buffers: shared hit=129 read=44119
- -> Partial Aggregate (cost=96331.58..96331.59 rows=1 width=8) (actual time=517.734..517.734 rows=1 loops=3)
- Buffers: shared hit=129 read=44119
- -> Parallel Seq Scan on test_1 (cost=0.00..85914.87 rows=4166687 width=0) (actual time=0.086..283.935 rows=3333333 loops=3)
- Buffers: shared hit=129 read=44119
- InitPlan 2 (returns $3)
- -> Finalize Aggregate (cost=49167.37..49167.38 rows=1 width=8) (actual time=245.154..245.196 rows=1 loops=1)
- Buffers: shared hit=11455 read=10670
- -> Gather (cost=49167.15..49167.36 rows=2 width=8) (actual time=245.086..245.190 rows=3 loops=1)
- Workers Planned: 2
- Workers Launched: 2
- Buffers: shared hit=11455 read=10670
- -> Partial Aggregate (cost=48167.15..48167.16 rows=1 width=8) (actual time=242.028..242.029 rows=1 loops=3)
- Buffers: shared hit=11455 read=10670
- -> Parallel Seq Scan on test_2 (cost=0.00..42958.72 rows=2083372 width=0) (actual time=0.019..130.565 rows=1666698 loops=3)
- Buffers: shared hit=11455 read=10670
- InitPlan 3 (returns $5)
- -> Finalize Aggregate (cost=10631.13..10631.14 rows=1 width=8) (actual time=51.357..51.389 rows=1 loops=1)
- Buffers: shared hit=4424
- -> Gather (cost=10630.92..10631.13 rows=2 width=8) (actual time=51.315..51.384 rows=3 loops=1)
- Workers Planned: 2
- Workers Launched: 2
- Buffers: shared hit=4424
- -> Partial Aggregate (cost=9630.92..9630.93 rows=1 width=8) (actual time=47.427..47.427 rows=1 loops=3)
- Buffers: shared hit=4424
- -> Parallel Seq Scan on test_3 (cost=0.00..8589.53 rows=416553 width=0) (actual time=0.006..25.158 rows=333243 loops=3)
- Buffers: shared hit=4424
- InitPlan 4 (returns $7)
- -> Finalize Aggregate (cost=49167.37..49167.38 rows=1 width=8) (actual time=245.959..246.003 rows=1 loops=1)
- Buffers: shared hit=11466 read=10659 written=4
- -> Gather (cost=49167.15..49167.36 rows=2 width=8) (actual time=245.890..245.998 rows=3 loops=1)
- Workers Planned: 2
- Workers Launched: 2
- Buffers: shared hit=11466 read=10659 written=4
- -> Partial Aggregate (cost=48167.15..48167.16 rows=1 width=8) (actual time=242.478..242.478 rows=1 loops=3)
- Buffers: shared hit=11466 read=10659 written=4
- -> Parallel Seq Scan on test_2 test_2_1 (cost=0.00..42958.72 rows=2083372 width=0) (actual time=0.065..130.902 rows=1666698 loops=3)
- Buffers: shared hit=11466 read=10659 written=4
- InitPlan 5 (returns $9)
- -> Finalize Aggregate (cost=97331.80..97331.81 rows=1 width=8) (actual time=502.641..504.263 rows=1 loops=1)
- Buffers: shared hit=209 read=44039 written=75
- -> Gather (cost=97331.58..97331.79 rows=2 width=8) (actual time=502.563..504.256 rows=3 loops=1)
- Workers Planned: 2
- Workers Launched: 2
- Buffers: shared hit=209 read=44039 written=75
- -> Partial Aggregate (cost=96331.58..96331.59 rows=1 width=8) (actual time=498.437..498.437 rows=1 loops=3)
- Buffers: shared hit=209 read=44039 written=75
- -> Parallel Seq Scan on test_1 test_1_1 (cost=0.00..85914.87 rows=4166687 width=0) (actual time=0.075..271.723 rows=3333333 loops=3)
- Buffers: shared hit=209 read=44039 written=75
- Planning:
- Buffers: shared hit=9
- Planning Time: 0.538 ms
- Execution Time: 1574.841 ms
- (61 rows)
- Time: 1576.377 ms (00:01.576)
- test_2=#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement