explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PpSY

Settings
# exclusive inclusive rows x rows loops node
1. 84.074 35,130.532 ↓ 10.9 111,715 1

Sort (cost=1,809,007.30..1,809,032.83 rows=10,210 width=638) (actual time=35,121.287..35,130.532 rows=111,715 loops=1)

  • Sort Key: oi.added_at
  • Sort Method: quicksort Memory: 78843kB
2. 137.918 35,046.458 ↓ 10.9 111,715 1

Hash Left Join (cost=1,708,753.40..1,808,327.43 rows=10,210 width=638) (actual time=34,577.900..35,046.458 rows=111,715 loops=1)

  • Hash Cond: (o.status_confirmed_by = u.id)
3. 23.232 34,905.754 ↓ 10.9 111,715 1

Hash Join (cost=1,708,084.06..1,807,377.68 rows=10,210 width=600) (actual time=34,575.091..34,905.754 rows=111,715 loops=1)

  • Hash Cond: (o.landing_id = l.id)
4. 170.722 34,879.870 ↓ 10.9 111,715 1

Merge Right Join (cost=1,707,729.43..1,806,882.66 rows=10,210 width=572) (actual time=34,572.430..34,879.870 rows=111,715 loops=1)

  • Merge Cond: (ot.order_id = o.id)
5. 1,150.928 8,518.035 ↓ 1.3 3,088,725 1

GroupAggregate (cost=920,260.27..989,337.40 rows=2,400,785 width=49) (actual time=6,231.794..8,518.035 rows=3,088,725 loops=1)

  • Group Key: ot.order_id
6. 5,998.720 7,367.107 ↑ 1.0 5,002,145 1

Sort (cost=920,260.27..933,282.71 rows=5,208,976 width=49) (actual time=6,231.786..7,367.107 rows=5,002,145 loops=1)

  • Sort Key: ot.order_id
  • Sort Method: external merge Disk: 298504kB
7. 1,037.332 1,368.387 ↓ 1.0 5,424,090 1

Hash Join (cost=5.42..161,090.60 rows=5,208,976 width=49) (actual time=0.042..1,368.387 rows=5,424,090 loops=1)

  • Hash Cond: (ot.tag_id = t.id)
8. 331.020 331.020 ↓ 1.0 5,424,090 1

Seq Scan on order_tags ot (cost=0.00..89,461.76 rows=5,208,976 width=16) (actual time=0.003..331.020 rows=5,424,090 loops=1)

9. 0.016 0.035 ↓ 1.0 155 1

Hash (cost=3.52..3.52 rows=152 width=49) (actual time=0.035..0.035 rows=155 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
10. 0.019 0.019 ↓ 1.0 155 1

Seq Scan on tags t (cost=0.00..3.52 rows=152 width=49) (actual time=0.004..0.019 rows=155 loops=1)

11. 93.266 26,191.113 ↓ 10.9 111,715 1

Sort (cost=787,469.16..787,494.69 rows=10,210 width=540) (actual time=26,178.092..26,191.113 rows=111,715 loops=1)

  • Sort Key: o.id
  • Sort Method: quicksort Memory: 72994kB
12. 27.130 26,097.847 ↓ 10.9 111,715 1

Nested Loop (cost=401,885.48..786,789.30 rows=10,210 width=540) (actual time=3,142.211..26,097.847 rows=111,715 loops=1)

13. 11.941 25,847.287 ↓ 4.2 111,715 1

Nested Loop (cost=401,885.04..773,626.44 rows=26,287 width=481) (actual time=3,142.203..25,847.287 rows=111,715 loops=1)

14. 25.624 25,285.509 ↓ 5.9 183,279 1

Nested Loop (cost=401,884.48..647,939.48 rows=31,124 width=252) (actual time=2,245.067..25,285.509 rows=183,279 loops=1)

  • Join Filter: (i_1.id = oi.integration_id)
15. 0.083 0.125 ↓ 30.0 30 1

Hash Join (cost=1.50..3.05 rows=1 width=48) (actual time=0.028..0.125 rows=30 loops=1)

  • Hash Cond: (i.id = i_1.id)
16. 0.026 0.026 ↓ 1.1 42 1

Seq Scan on integrations i (cost=0.00..1.39 rows=39 width=40) (actual time=0.007..0.026 rows=42 loops=1)

17. 0.005 0.016 ↓ 30.0 30 1

Hash (cost=1.49..1.49 rows=1 width=8) (actual time=0.016..0.016 rows=30 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
18. 0.011 0.011 ↓ 30.0 30 1

Seq Scan on integrations i_1 (cost=0.00..1.49 rows=1 width=8) (actual time=0.005..0.011 rows=30 loops=1)

  • Filter: (type_id = 2)
  • Rows Removed by Filter: 12
19. 2,022.570 25,259.760 ↑ 6.4 6,109 30

Bitmap Heap Scan on order_integrations oi (cost=401,882.98..647,446.98 rows=39,156 width=228) (actual time=811.241..841.992 rows=6,109 loops=30)

  • Recheck Cond: (integration_id = i.id)
  • Filter: ((added_at IS NOT NULL) AND (removed_at IS NULL) AND (added_at >= '2019-04-01 00:00:00+00'::timestamp with time zone) AND (added_at <= '2019-05-21 00:00:00+00'::timestamp with time zone))
  • Rows Removed by Filter: 158018
  • Heap Blocks: exact=1240258
20. 23,237.190 23,237.190 ↑ 9.3 164,813 30

Bitmap Index Scan on idx_order_integrations_order_id_integration_id (cost=0.00..401,873.20 rows=1,537,203 width=0) (actual time=774.573..774.573 rows=164,813 loops=30)

  • Index Cond: (integration_id = i.id)
21. 549.837 549.837 ↑ 1.0 1 183,279

Index Scan using orders_pkey on orders o (cost=0.56..4.03 rows=1 width=237) (actual time=0.003..0.003 rows=1 loops=183,279)

  • Index Cond: (id = oi.order_id)
  • Filter: (country = ANY ('{Россия,Казахстан,Киргизия}'::text[]))
  • Rows Removed by Filter: 0
22. 223.430 223.430 ↑ 1.0 1 111,715

Index Scan using variants_pkey on variants v (cost=0.43..0.49 rows=1 width=75) (actual time=0.002..0.002 rows=1 loops=111,715)

  • Index Cond: (id = o.variant_id)
23. 0.298 2.652 ↓ 1.0 2,836 1

Hash (cost=320.21..320.21 rows=2,754 width=44) (actual time=2.652..2.652 rows=2,836 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 254kB
24. 0.558 2.354 ↓ 1.0 2,836 1

Hash Join (cost=203.80..320.21 rows=2,754 width=44) (actual time=1.638..2.354 rows=2,836 loops=1)

  • Hash Cond: (l.offer_id = of.id)
25. 0.166 0.166 ↓ 1.0 2,836 1

Seq Scan on landings l (cost=0.00..78.54 rows=2,754 width=16) (actual time=0.002..0.166 rows=2,836 loops=1)

26. 0.185 1.630 ↓ 1.0 1,596 1

Hash (cost=183.91..183.91 rows=1,591 width=44) (actual time=1.630..1.630 rows=1,596 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 142kB
27. 1.445 1.445 ↓ 1.0 1,596 1

Seq Scan on offers of (cost=0.00..183.91 rows=1,591 width=44) (actual time=0.005..1.445 rows=1,596 loops=1)

28. 1.253 2.786 ↓ 1.0 10,234 1

Hash (cost=541.93..541.93 rows=10,193 width=54) (actual time=2.786..2.786 rows=10,234 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1032kB
29. 1.533 1.533 ↓ 1.0 10,234 1

Seq Scan on users u (cost=0.00..541.93 rows=10,193 width=54) (actual time=0.005..1.533 rows=10,234 loops=1)

Planning time : 1.747 ms
Execution time : 35,190.257 ms