explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YA0f : Optimization for: Optimization for: evalution of vi_get_points; plan #K81I; plan #mNXs

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 250.624 307.708 ↓ 16.2 779 1

CTE Scan on filtered_points points (cost=11,712.27..12,189.72 rows=48 width=232) (actual time=53.658..307.708 rows=779 loops=1)

2.          

CTE selected_points

3. 5.369 49.480 ↓ 9.2 1,784 1

Gather (cost=1,000.00..11,643.25 rows=194 width=361) (actual time=0.396..49.480 rows=1,784 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 44.111 44.111 ↓ 7.3 595 3

Parallel Seq Scan on points points_1 (cost=0.00..10,623.85 rows=81 width=361) (actual time=0.208..44.111 rows=595 loops=3)

  • Filter: ('0103000000010000000500000048E17A14AEC72840068195438BAC494048E17A14AEC72840EC51B81E85AB4940C3F5285C8FC22840EC51B81E85AB4940C3F5285C8FC22840068195438BAC494048E17A14AEC72840068195438BAC4940'::geometry ~ offset_geom)
  • Rows Removed by Filter: 64228
5.          

CTE filtered_points

6. 50.919 50.919 ↓ 16.2 779 1

CTE Scan on selected_points points_2 (cost=0.00..3.88 rows=48 width=959) (actual time=0.846..50.919 rows=779 loops=1)

  • Filter: ((offset_geom IS NOT NULL) AND (is_duplicate IS FALSE) AND (is_latest IS TRUE))
  • Rows Removed by Filter: 1005
7.          

CTE points_with_objects

8. 0.002 52.408 ↓ 0.0 0 1

HashAggregate (cost=62.50..63.10 rows=48 width=548) (actual time=52.408..52.408 rows=0 loops=1)

  • Group Key: points_3.id
9. 0.005 52.406 ↓ 0.0 0 1

Hash Join (cost=3.12..61.97 rows=105 width=526) (actual time=52.406..52.406 rows=0 loops=1)

  • Hash Cond: (detected_objects.point_id = (points_3.id)::text)
10. 0.577 1.538 ↓ 0.0 0 1

Hash Semi Join (cost=1.56..59.97 rows=105 width=563) (actual time=1.537..1.538 rows=0 loops=1)

  • Hash Cond: (detected_objects.point_id = (filtered_points.id)::text)
11. 0.290 0.290 ↑ 1.0 2,316 1

Seq Scan on detected_objects (cost=0.00..51.16 rows=2,316 width=47) (actual time=0.010..0.290 rows=2,316 loops=1)

12. 0.316 0.671 ↓ 16.2 779 1

Hash (cost=0.96..0.96 rows=48 width=516) (actual time=0.671..0.671 rows=779 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 61kB
13. 0.355 0.355 ↓ 16.2 779 1

CTE Scan on filtered_points (cost=0.00..0.96 rows=48 width=516) (actual time=0.001..0.355 rows=779 loops=1)

14. 0.425 50.863 ↓ 16.2 779 1

Hash (cost=0.96..0.96 rows=48 width=516) (actual time=50.863..50.863 rows=779 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 61kB
15. 50.438 50.438 ↓ 16.2 779 1

CTE Scan on filtered_points points_3 (cost=0.00..0.96 rows=48 width=516) (actual time=0.001..50.438 rows=779 loops=1)

16.          

CTE detected_ids

17. 52.409 52.409 ↓ 0.0 0 1

CTE Scan on points_with_objects (cost=0.00..0.96 rows=48 width=516) (actual time=52.409..52.409 rows=0 loops=1)

18.          

SubPlan (forCTE Scan)

19. 0.779 4.674 ↑ 1.0 1 779

Limit (cost=0.29..6.30 rows=1 width=9) (actual time=0.005..0.006 rows=1 loops=779)

20. 3.895 3.895 ↑ 2.0 1 779

Index Scan using idx_segment_stats_segment_id on segment_stats (cost=0.29..12.31 rows=2 width=9) (actual time=0.005..0.005 rows=1 loops=779)

  • Index Cond: (points.segment_id = segment_id)
21. 52.410 52.410 ↓ 0.0 0 1

CTE Scan on detected_ids (cost=0.00..0.96 rows=48 width=516) (actual time=52.410..52.410 rows=0 loops=1)

22. 0.000 0.000 ↓ 0.0 0

CTE Scan on points_with_objects objects (cost=0.00..1.08 rows=1 width=32) (never executed)

  • Filter: ((points.id)::text = (point_id)::text)
Planning time : 1.198 ms
Execution time : 308.144 ms