explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cIyJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.019 17.405 ↑ 1.0 11 1

Hash Join (cost=2,216.21..2,216.58 rows=11 width=7,767) (actual time=17.397..17.405 rows=11 loops=1)

  • Buffers: shared hit=1,132
2.          

CTE root

3. 0.007 15.082 ↑ 1.0 11 1

Limit (cost=10.73..1,099.46 rows=11 width=2,933) (actual time=1.771..15.082 rows=11 loops=1)

  • Buffers: shared hit=106
4. 0.013 15.075 ↑ 547.8 11 1

Nested Loop (cost=10.73..596,436.55 rows=6,026 width=2,933) (actual time=1.769..15.075 rows=11 loops=1)

  • Buffers: shared hit=106
5. 7.656 15.062 ↑ 547.8 11 1

Nested Loop (cost=0.28..593,714.14 rows=6,026 width=3,024) (actual time=1.764..15.062 rows=11 loops=1)

  • Buffers: shared hit=106
6. 0.047 0.047 ↑ 592.6 11 1

Index Scan using to_created_at_index on topology_operation o_1 (cost=0.28..4,278.34 rows=6,519 width=3,024) (actual time=0.028..0.047 rows=11 loops=1)

  • Buffers: shared hit=13
7. 6.154 7.359 ↑ 1.0 5,772 11

Materialize (cost=0..198.45 rows=6,026 width=37) (actual time=0.001..0.669 rows=5,772 loops=11)

  • Buffers: shared hit=93
8. 1.205 1.205 ↑ 1.0 5,995 1

Seq Scan on operation_shares os (cost=0..168.32 rows=6,026 width=37) (actual time=0.007..1.205 rows=5,995 loops=1)

  • Filter: (os.tenant_id = '0e8a2883-df5d-42aa-9d84-2b02137ef479'::uuid)
  • Buffers: shared hit=93
9. 0.000 0.000 ↓ 0.0 0 11

Materialize (cost=10.45..11.2 rows=30 width=524) (actual time=0..0 rows=0 loops=11)

10. 0.001 0.004 ↓ 0.0 0 1

Subquery Scan on g (cost=10.45..11.05 rows=30 width=524) (actual time=0.003..0.004 rows=0 loops=1)

11. 0.001 0.003 ↓ 0.0 0 1

Aggregate (cost=10.45..10.75 rows=30 width=524) (actual time=0.003..0.003 rows=0 loops=1)

12. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on grant_response grant_response (cost=0..10.3 rows=30 width=1,032) (actual time=0.001..0.002 rows=0 loops=1)

13.          

CTE counts

14. 0.010 15.595 ↑ 1.0 11 1

Aggregate (cost=1,116.19..1,116.39 rows=11 width=524) (actual time=15.589..15.595 rows=11 loops=1)

  • Buffers: shared hit=1,080
15. 0.027 15.585 ↑ 1.0 11 1

Sort (cost=1,116.19..1,116.22 rows=11 width=516) (actual time=15.584..15.585 rows=11 loops=1)

  • Sort Key: r.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=1,080
16. 0.668 15.558 ↑ 1.0 11 1

Hash Join (cost=0.36..1,116 rows=11 width=516) (actual time=15.554..15.558 rows=11 loops=1)

  • Buffers: shared hit=1,080
17. 1.547 1.547 ↑ 1.1 5,995 1

Seq Scan on topology_operation t (cost=0..1,091.19 rows=6,519 width=516) (actual time=0.011..1.547 rows=5,995 loops=1)

  • Buffers: shared hit=1,026
18. 0.011 13.343 ↑ 1.0 11 1

Hash (cost=0.22..0.22 rows=11 width=516) (actual time=13.342..13.343 rows=11 loops=1)

  • Buffers: shared hit=54
19. 13.332 13.332 ↑ 1.0 11 1

CTE Scan on root r (cost=0..0.22 rows=11 width=516) (actual time=0..13.332 rows=11 loops=1)

  • Buffers: shared hit=54
20. 1.778 1.778 ↑ 1.0 11 1

CTE Scan on root o (cost=0..0.22 rows=11 width=7,759) (actual time=1.775..1.778 rows=11 loops=1)

  • Buffers: shared hit=52
21. 0.007 15.608 ↑ 1.0 11 1

Hash (cost=0.22..0.22 rows=11 width=524) (actual time=15.608..15.608 rows=11 loops=1)

  • Buffers: shared hit=1,080
22. 15.601 15.601 ↑ 1.0 11 1

CTE Scan on counts c (cost=0..0.22 rows=11 width=524) (actual time=15.592..15.601 rows=11 loops=1)

  • Buffers: shared hit=1,080
Planning time : 0.436 ms
Execution time : 17.621 ms