explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vAYG

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 459.089 ↓ 2.0 2 1

Limit (cost=52,570.43..189,375.81 rows=1 width=5) (actual time=392.450..459.089 rows=2 loops=1)

2. 3.633 459.087 ↓ 2.0 2 1

Nested Loop (cost=52,570.43..189,375.81 rows=1 width=5) (actual time=392.449..459.087 rows=2 loops=1)

  • Join Filter: (graphql_adventures.id = adventures_guidebooks.adventure_id)
  • Rows Removed by Join Filter: 36136
3. 0.010 0.010 ↑ 3.5 2 1

Index Scan using index_adventures_guidebooks_on_guidebook_id_and_position on adventures_guidebooks (cost=0.28..17.78 rows=7 width=8) (actual time=0.006..0.010 rows=2 loops=1)

  • Index Cond: (guidebook_id = 263)
4. 6.026 455.444 ↓ 30.8 18,069 2

Materialize (cost=52,570.15..189,297.97 rows=586 width=5) (actual time=133.969..227.722 rows=18,069 loops=2)

5. 8.559 449.418 ↓ 37.9 22,223 1

Subquery Scan on graphql_adventures (cost=52,570.15..189,295.04 rows=586 width=5) (actual time=267.934..449.418 rows=22,223 loops=1)

  • Filter: (graphql_adventures.geometry_type = 'LINE'::text)
6. 6.748 440.859 ↑ 5.3 22,223 1

Unique (cost=52,570.15..187,829.81 rows=117,218 width=932) (actual time=267.932..440.859 rows=22,223 loops=1)

7. 0.000 434.111 ↑ 3.9 30,091 1

Gather Merge (cost=52,570.15..187,536.77 rows=117,218 width=932) (actual time=267.931..434.111 rows=30,091 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 27.676 894.132 ↑ 4.8 10,073 3

Nested Loop Left Join (cost=51,570.13..173,006.88 rows=48,841 width=8,853) (actual time=256.305..298.044 rows=10,073 loops=3)

  • Filter: ((geo_lines.line IS NOT NULL) OR (geo_points.point IS NOT NULL))
  • Rows Removed by Filter: 3
9. 19.797 806.004 ↑ 4.8 10,075 3

Merge Left Join (cost=51,569.71..52,392.29 rows=48,841 width=49) (actual time=256.283..268.668 rows=10,075 loops=3)

  • Merge Cond: (adventures.id = adventures_regions.adventure_id)
10. 81.060 373.152 ↑ 6.6 7,450 3

Sort (cost=45,628.34..45,750.44 rows=48,841 width=49) (actual time=122.963..124.384 rows=7,450 loops=3)

  • Sort Key: adventures.id
  • Sort Method: quicksort Memory: 3344kB
11. 82.599 292.092 ↑ 1.2 39,073 3

Hash Join (cost=5.95..41,824.65 rows=48,841 width=49) (actual time=0.143..97.364 rows=39,073 loops=3)

  • Hash Cond: (adventures.adventure_type_id = adventure_types.id)
12. 112.458 209.433 ↑ 1.2 39,073 3

Hash Left Join (cost=4.47..41,669.09 rows=48,841 width=53) (actual time=0.080..69.811 rows=39,073 loops=3)

  • Hash Cond: (adventures.geo_point_id = geo_points.id)
13. 96.798 96.798 ↑ 1.2 39,073 3

Parallel Seq Scan on adventures (cost=0.00..41,536.41 rows=48,841 width=21) (actual time=0.003..32.266 rows=39,073 loops=3)

14. 0.087 0.177 ↑ 1.0 110 3

Hash (cost=3.10..3.10 rows=110 width=48) (actual time=0.059..0.059 rows=110 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
15. 0.090 0.090 ↑ 1.0 110 3

Seq Scan on geo_points (cost=0.00..3.10 rows=110 width=48) (actual time=0.009..0.030 rows=110 loops=3)

16. 0.024 0.060 ↑ 1.0 21 3

Hash (cost=1.21..1.21 rows=21 width=4) (actual time=0.020..0.020 rows=21 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.036 0.036 ↑ 1.0 21 3

Seq Scan on adventure_types (cost=0.00..1.21 rows=21 width=4) (actual time=0.009..0.012 rows=21 loops=3)

18. 375.507 413.055 ↑ 2.3 27,033 3

Sort (cost=5,941.37..6,099.11 rows=63,096 width=8) (actual time=133.313..137.685 rows=27,033 loops=3)

  • Sort Key: adventures_regions.adventure_id
  • Sort Method: external sort Disk: 1320kB
19. 37.548 37.548 ↑ 1.0 60,829 3

Seq Scan on adventures_regions (cost=0.00..910.96 rows=63,096 width=8) (actual time=0.025..12.516 rows=60,829 loops=3)

20. 60.452 60.452 ↑ 1.0 1 30,226

Index Scan using geo_lines_pkey on geo_lines (cost=0.42..2.46 rows=1 width=8,812) (actual time=0.002..0.002 rows=1 loops=30,226)

  • Index Cond: (adventures.geo_line_id = id)
Planning time : 1.117 ms
Execution time : 464.176 ms