explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AtF5

Settings
# exclusive inclusive rows x rows loops node
1. 1,911.545 41,047.876 ↓ 0.0 0 1

Hash Join (cost=968,392.09..4,182,484.71 rows=6,493,586 width=2,057) (actual time=41,047.876..41,047.876 rows=0 loops=1)

  • Hash Cond: (orders_order.client_id = v0.id)
2. 22,555.578 22,555.578 ↑ 1.1 7,140,893 1

Seq Scan on orders_order (cost=0.00..3,192,598.10 rows=8,188,386 width=2,057) (actual time=912.149..22,555.578 rows=7,140,893 loops=1)

  • Filter: ((has_requested_data_removal OR (has_requested_data_removal IS NULL)) AND (assigned_to_callcenter_id = 1))
  • Rows Removed by Filter: 9,161,300
3. 0.008 16,580.753 ↑ 5,540,043.0 1 1

Hash (cost=899,141.55..899,141.55 rows=5,540,043 width=4) (actual time=16,580.752..16,580.753 rows=1 loops=1)

  • Buckets: 8,388,608 Batches: 1 Memory Usage: 65,537kB
4. 31.383 16,580.745 ↑ 5,540,043.0 1 1

HashAggregate (cost=788,340.69..843,741.12 rows=5,540,043 width=4) (actual time=16,563.993..16,580.745 rows=1 loops=1)

  • Group Key: v0.id
5. 7,961.298 16,549.362 ↑ 5,540,043.0 1 1

Hash Right Join (cost=340,646.83..774,490.58 rows=5,540,043 width=4) (actual time=13,881.700..16,549.362 rows=1 loops=1)

  • Hash Cond: (v1.client_id = v0.id)
  • Filter: ((hashed SubPlan 1) OR (v0.id = 31,506,488))
  • Rows Removed by Filter: 12,996,941
6. 1,863.582 1,863.582 ↓ 1.0 12,696,246 1

Seq Scan on orders_clientphone v1 (cost=0.00..400,527.81 rows=12,691,781 width=20) (actual time=0.017..1,863.582 rows=12,696,246 loops=1)

7. 3,135.367 6,706.053 ↓ 1.1 11,665,805 1

Hash (cost=204,579.12..204,579.12 rows=10,884,991 width=4) (actual time=6,706.053..6,706.053 rows=11,665,805 loops=1)

  • Buckets: 16,777,216 Batches: 1 Memory Usage: 541,198kB
8. 3,570.686 3,570.686 ↓ 1.1 11,665,805 1

Index Only Scan using orders_client_pkey_deduplication_partial_idx on orders_client v0 (cost=0.43..204,579.12 rows=10,884,991 width=4) (actual time=0.093..3,570.686 rows=11,665,805 loops=1)

  • Heap Fetches: 1,358,689
9.          

SubPlan (for Hash Right Join)

10. 0.001 18.429 ↑ 1.0 1 1

Unique (cost=5.32..5.33 rows=1 width=16) (actual time=18.429..18.429 rows=1 loops=1)

11. 0.041 18.428 ↑ 1.0 1 1

Sort (cost=5.32..5.33 rows=1 width=16) (actual time=18.428..18.428 rows=1 loops=1)

  • Sort Key: u0.contact_detail_id
  • Sort Method: quicksort Memory: 25kB
12. 0.009 18.387 ↑ 1.0 1 1

Nested Loop (cost=0.87..5.31 rows=1 width=16) (actual time=18.385..18.387 rows=1 loops=1)

13. 18.314 18.314 ↑ 1.0 1 1

Index Scan using orders_clientphone_client_id on orders_clientphone u0 (cost=0.43..2.66 rows=1 width=16) (actual time=18.312..18.314 rows=1 loops=1)

  • Index Cond: (client_id = 31,506,488)
  • Filter: ((contact_detail_id IS NOT NULL) AND ((phone_type <> 3) OR (phone_type IS NULL)))
14. 0.064 0.064 ↑ 1.0 1 1

Index Scan using orders_contactdetail_pkey on orders_contactdetail u2 (cost=0.43..2.66 rows=1 width=16) (actual time=0.064..0.064 rows=1 loops=1)

  • Index Cond: (uuid = u0.contact_detail_id)
  • Filter: (type <> 3)
Planning time : 23.769 ms