explain.depesz.com

PostgreSQL's explain analyze made readable

Result: t0II

Settings
# exclusive inclusive rows x rows loops node
1. 5.964 519,219.650 ↑ 251.8 1,342 1

Unique (cost=8,881,039.22..8,888,641.45 rows=337,877 width=81) (actual time=519,210.650..519,219.650 rows=1,342 loops=1)

2. 0.000 519,213.686 ↑ 18.0 18,769 1

Sort (cost=8,881,039.22..8,881,883.91 rows=337,877 width=81) (actual time=519,210.648..519,213.686 rows=18,769 loops=1)

  • Sort Key: oc.id, oc.created_time, oc.deleted, oc.updated_time, oc.version, oc.capture_time, oc.order_item_id, oc.container_id
  • Sort Method: quicksort Memory: 3225kB
3. 3,240.473 519,330.636 ↑ 18.0 18,769 1

Gather (cost=6,097,164.21..8,833,841.74 rows=337,877 width=81) (actual time=364,510.272..519,330.636 rows=18,769 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 5.266 516,090.163 ↑ 22.5 6,256 3

Hash Join (cost=6,096,164.21..8,799,054.04 rows=140,782 width=81) (actual time=378,762.737..516,090.163 rows=6,256 loops=3)

  • Hash Cond: (oc.container_id = c.id)
5. 135,987.438 516,084.484 ↑ 22.5 6,256 3

Hash Join (cost=6,096,129.86..8,798,647.95 rows=140,918 width=81) (actual time=378,762.246..516,084.484 rows=6,256 loops=3)

  • Hash Cond: (oc.order_item_id = oi.id)
  • Join Filter: (((oc.updated_time > '2019-10-07 19:06:32.373787+03'::timestamp with time zone) AND (oc.updated_time <= '2019-10-07 20:06:32.373787+03'::timestamp with time zone)) OR ((oi.updated_time > '2019-10-07 19:06:32.373787+03'::timestamp with time zone) AND (oi.updated_time <= '2019-10-07 20:06:32.373787+03'::timestamp with time zone)) OR ((o.updated_time > '2019-10-07 19:06:32.373787+03'::timestamp with time zone) AND (o.updated_time <= '2019-10-07 20:06:32.373787+03'::timestamp with time zone)) OR ((v.updated_time > '2019-10-07 19:06:32.373787+03'::timestamp with time zone) AND (v.updated_time <= '2019-10-07 20:06:32.373787+03'::timestamp with time zone)) OR ((tsto.updated_time > '2019-10-07 19:06:32.373787+03'::timestamp with time zone) AND (tsto.updated_time <= '2019-10-07 20:06:32.373787+03'::timestamp with time zone)))
  • Rows Removed by Join Filter: 38346179
6. 21,850.508 21,850.508 ↑ 1.2 9,387,155 3

Parallel Seq Scan on order_container oc (cost=0.00..521,990.27 rows=11,733,927 width=81) (actual time=0.014..21,850.508 rows=9,387,155 loops=3)

7. 13,427.679 358,246.538 ↓ 1.1 33,873,462 3

Hash (cost=5,347,982.16..5,347,982.16 rows=32,189,176 width=64) (actual time=358,246.538..358,246.538 rows=33,873,462 loops=3)

  • Buckets: 65536 Batches: 1024 Memory Usage: 3596kB
8. 92,174.260 344,818.859 ↓ 1.1 33,873,462 3

Hash Join (cost=2,310,131.42..5,347,982.16 rows=32,189,176 width=64) (actual time=165,445.670..344,818.859 rows=33,873,462 loops=3)

  • Hash Cond: (tsto.order_item_id = oi.id)
9. 87,201.602 87,201.602 ↑ 1.0 51,681,972 3

Seq Scan on test_order tsto (cost=0.00..1,105,357.81 rows=51,790,981 width=24) (actual time=0.027..87,201.602 rows=51,681,972 loops=3)

10. 6,204.612 165,442.997 ↓ 1.0 12,813,382 3

Hash (cost=2,057,066.23..2,057,066.23 rows=12,458,575 width=40) (actual time=165,442.997..165,442.997 rows=12,813,382 loops=3)

  • Buckets: 65536 Batches: 256 Memory Usage: 4060kB
11. 7,817.739 159,238.385 ↓ 1.0 12,813,382 3

Hash Join (cost=1,030,213.31..2,057,066.23 rows=12,458,575 width=40) (actual time=16,221.450..159,238.385 rows=12,813,382 loops=3)

  • Hash Cond: (v.branch_office_id = bo.id)
12. 71,626.797 151,405.270 ↓ 1.0 12,992,000 3

Hash Join (cost=1,028,932.16..2,022,163.20 rows=12,805,607 width=56) (actual time=16,152.814..151,405.270 rows=12,992,000 loops=3)

  • Hash Cond: (o.visit_id = v.id)
13. 59,541.362 71,201.954 ↓ 1.0 12,992,000 3

Hash Join (cost=505,404.76..1,141,764.17 rows=12,989,188 width=48) (actual time=7,528.688..71,201.954 rows=12,992,000 loops=3)

  • Hash Cond: (oi.order_id = o.id)
14. 4,143.632 4,143.632 ↓ 1.0 13,007,442 3

Seq Scan on order_item oi (cost=0.00..304,403.98 rows=13,007,398 width=40) (actual time=0.033..4,143.632 rows=13,007,442 loops=3)

15. 4,157.848 7,516.960 ↓ 1.0 12,104,777 3

Hash (cost=259,526.45..259,526.45 rows=12,104,745 width=40) (actual time=7,516.960..7,516.960 rows=12,104,777 loops=3)

  • Buckets: 65536 Batches: 256 Memory Usage: 3848kB
16. 3,359.112 3,359.112 ↓ 1.0 12,104,777 3

Seq Scan on order_ o (cost=0.00..259,526.45 rows=12,104,745 width=40) (actual time=0.011..3,359.112 rows=12,104,777 loops=3)

17. 4,811.302 8,576.519 ↑ 1.0 12,089,169 3

Hash (cost=277,961.51..277,961.51 rows=12,089,351 width=40) (actual time=8,576.519..8,576.519 rows=12,089,169 loops=3)

  • Buckets: 65536 Batches: 256 Memory Usage: 3826kB
18. 3,765.217 3,765.217 ↑ 1.0 12,089,169 3

Seq Scan on visit v (cost=0.00..277,961.51 rows=12,089,351 width=40) (actual time=0.028..3,765.217 rows=12,089,169 loops=3)

19. 8.975 15.376 ↓ 1.0 19,347 3

Hash (cost=1,039.40..1,039.40 rows=19,340 width=16) (actual time=15.376..15.376 rows=19,347 loops=3)

  • Buckets: 32768 Batches: 1 Memory Usage: 1163kB
20. 6.401 6.401 ↓ 1.0 19,347 3

Seq Scan on branch_office bo (cost=0.00..1,039.40 rows=19,340 width=16) (actual time=0.016..6.401 rows=19,347 loops=3)

21. 0.193 0.413 ↓ 1.0 871 3

Hash (cost=23.60..23.60 rows=860 width=16) (actual time=0.412..0.413 rows=871 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 49kB
22. 0.220 0.220 ↓ 1.0 871 3

Seq Scan on container c (cost=0.00..23.60 rows=860 width=16) (actual time=0.015..0.220 rows=871 loops=3)