explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Mdxf

Settings
# exclusive inclusive rows x rows loops node
1. 191.676 31,805.133 ↑ 1.4 12,003 1

Merge Anti Join (cost=8,242.93..11,777.81 rows=16,206 width=1,619) (actual time=325.743..31,805.133 rows=12,003 loops=1)

  • Merge Cond: (c.id = oi.contract_id)
2. 191.156 332.706 ↓ 1.1 18,806 1

Sort (cost=8,242.36..8,283.99 rows=16,652 width=1,619) (actual time=325.703..332.706 rows=18,806 loops=1)

  • Sort Key: c.id
  • Sort Method: quicksort Memory: 19706kB
3. 36.102 141.550 ↓ 1.1 18,806 1

Hash Join (cost=1,139.01..7,074.78 rows=16,652 width=1,619) (actual time=21.571..141.550 rows=18,806 loops=1)

  • Hash Cond: (c.id = cr.contract_id)
4. 84.007 84.007 ↓ 1.1 20,875 1

Seq Scan on partners_partnercontract c (cost=0.00..5,698.60 rows=18,785 width=1,505) (actual time=0.012..84.007 rows=20,875 loops=1)

  • Filter: ((sales_manager_acquired_at IS NULL) AND ((punishment_rules IS NULL) OR ((punishment_rules)::text = ''::text)) AND ((brand)::text = 'ostrovok'::text) AND (created_date <= (now() - '1 year'::interval)))
  • Rows Removed by Filter: 19081
5. 9.709 21.441 ↓ 1.0 35,489 1

Hash (cost=696.46..696.46 rows=35,404 width=114) (actual time=21.441..21.441 rows=35,489 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2466kB
6. 11.732 11.732 ↓ 1.0 35,489 1

Seq Scan on partners_partnercreditrisk cr (cost=0.00..696.46 rows=35,404 width=114) (actual time=0.011..11.732 rows=35,489 loops=1)

  • Filter: (total_unpaid IS NULL)
  • Rows Removed by Filter: 4157
7. 31,280.751 31,280.751 ↑ 1.0 917,970 1

Index Only Scan using idx_orderitem_contract_paidat on orders_orderitem oi (cost=0.42..14,141.12 rows=944,716 width=4) (actual time=0.033..31,280.751 rows=917,970 loops=1)

  • Heap Fetches: 446798
Planning time : 1.275 ms
Execution time : 31,808.204 ms