explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yLO6

Settings
# exclusive inclusive rows x rows loops node
1. 1,278.328 16,641.518 ↓ 2.9 29,226 1

HashAggregate (cost=69,579.01..69,680.10 rows=10,109 width=43) (actual time=12,740.670..16,641.518 rows=29,226 loops=1)

  • Group Key: x.point_from_id, x.point_to_id, x.organization_id, x.init_point_id, x.tariff_type
  • Filter: ((x.init_point_id <> x.point_to_id) OR ((SubPlan 1) IS NULL))
  • Rows Removed by Filter: 25,994
2. 922.441 11,931.982 ↓ 4.8 488,419 1

Group (cost=36,350.37..67,304.44 rows=101,092 width=52) (actual time=4,834.858..11,931.982 rows=488,419 loops=1)

  • Group Key: x.transport_type_id, x.point_from_id, x.point_to_id, x.organization_id, x.init_point_id, x.tariff_type, x.is_deleted
3. 5,859.537 11,009.541 ↓ 2.4 488,419 1

Gather Merge (cost=36,350.37..63,766.22 rows=202,184 width=52) (actual time=4,834.855..11,009.541 rows=488,419 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 184.707 5,150.004 ↓ 1.6 162,806 3 / 3

Group (cost=35,350.35..39,429.15 rows=101,092 width=52) (actual time=4,731.592..5,150.004 rows=162,806 loops=3)

  • Group Key: x.transport_type_id, x.point_from_id, x.point_to_id, x.organization_id, x.init_point_id, x.tariff_type, x.is_deleted
5. 3,878.015 4,965.297 ↑ 1.3 162,806 3 / 3

Sort (cost=35,350.35..35,860.20 rows=203,940 width=52) (actual time=4,731.587..4,965.297 rows=162,806 loops=3)

  • Sort Key: x.transport_type_id, x.point_from_id, x.point_to_id, x.organization_id, x.init_point_id, x.tariff_type, x.is_deleted
  • Sort Method: external merge Disk: 10,888kB
6. 1,087.282 1,087.282 ↑ 1.3 162,806 3 / 3

Parallel Seq Scan on organization_rate_directions x (cost=0.00..10,393.10 rows=203,940 width=52) (actual time=0.084..1,087.282 rows=162,806 loops=3)

  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 5,681
7.          

SubPlan (for HashAggregate)

8. 259.940 3,431.208 ↑ 1.0 1 25,994

Group (cost=8.46..8.48 rows=1 width=76) (actual time=0.116..0.132 rows=1 loops=25,994)

  • Group Key: rr.organization_id, rr.init_point_id, rr.tariff_type, rr.is_deleted, rr.point_from_id, rr.point_to_id
9. 441.898 3,171.268 ↓ 9.0 9 25,994

Sort (cost=8.46..8.46 rows=1 width=44) (actual time=0.116..0.122 rows=9 loops=25,994)

  • Sort Key: rr.is_deleted
  • Sort Method: quicksort Memory: 25kB
10. 2,729.370 2,729.370 ↓ 9.0 9 25,994

Index Scan using idx_organization_rate_directions_unique on organization_rate_directions rr (cost=0.42..8.45 rows=1 width=44) (actual time=0.039..0.105 rows=9 loops=25,994)

  • Index Cond: ((organization_id = x.organization_id) AND (point_from_id = x.point_to_id) AND (point_to_id = x.point_from_id) AND (init_point_id = x.init_point_id) AND ((tariff_type)::text = (x.tariff_type)::text))
Planning time : 0.291 ms
Execution time : 16,646.814 ms