explain.depesz.com

PostgreSQL's explain analyze made readable

Result: j9Sa : Original

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 669.694 2,511.961 ↓ 1.3 1,000,000 1

Unique (cost=287,608.87..296,983.88 rows=750,001 width=612) (actual time=1,625.416..2,511.961 rows=1,000,000 loops=1)

2. 1,017.262 1,842.267 ↓ 1.3 1,000,000 1

Sort (cost=287,608.87..289,483.87 rows=750,001 width=612) (actual time=1,625.413..1,842.267 rows=1,000,000 loops=1)

  • Sort Key: mktsegpmmperftest1mgogle.pysubjectid, mktsegpmmperftest1mgogle.partitionkey, ('ADD'::text), ('DK86aed1f2'::text)
  • Sort Method: quicksort Memory: 102702kB
3. 397.495 825.005 ↓ 1.3 1,000,000 1

Append (cost=22,952.82..97,233.77 rows=750,001 width=612) (actual time=46.356..825.005 rows=1,000,000 loops=1)

4. 334.689 381.024 ↓ 1.3 1,000,000 1

Seq Scan on mktsegpmmperftest1mgogle (cost=22,952.82..44,242.82 rows=750,000 width=80) (actual time=46.355..381.024 rows=1,000,000 loops=1)

  • Filter: ((NOT (hashed SubPlan 1)) OR (hashed SubPlan 2))
5.          

SubPlan (forSeq Scan)

6. 46.335 46.335 ↓ 0.0 0 1

Index Scan using mkt_paidmedia_master_idx1 on mkt_paidmedia_master mkt_paidmedia_master_1 (cost=0.42..22,950.92 rows=1 width=11) (actual time=46.335..46.335 rows=0 loops=1)

  • Index Cond: (((accounttype)::text = 'Google'::text) AND ((accountid)::text = '133-941-2293'::text))
  • Filter: ((upper((identifier)::text) = 'PMMPERFTEST1MGOGLE'::text) AND (upper((forceresync)::text) = 'FALSE'::text))
7. 0.000 0.000 ↓ 0.0 0

Index Scan using mkt_paidmedia_master_idx2 on mkt_paidmedia_master mkt_paidmedia_master_2 (cost=0.42..1.90 rows=1 width=11) (never executed)

  • Index Cond: (((action)::text = 'ADD'::text) AND ((status)::text = 'FAILED'::text))
  • Filter: (((accounttype)::text = 'Google'::text) AND ((accountid)::text = '133-941-2293'::text) AND (upper((identifier)::text) = 'PMMPERFTEST1MGOGLE'::text) AND (upper((forceresync)::text) = 'FALSE'::text))
8. 0.001 46.486 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=18,790.42..41,740.94 rows=1 width=107) (actual time=46.486..46.486 rows=0 loops=1)

9. 46.485 46.485 ↓ 0.0 0 1

Index Scan using mkt_paidmedia_master_idx1 on mkt_paidmedia_master (cost=18,790.42..41,740.93 rows=1 width=79) (actual time=46.485..46.485 rows=0 loops=1)

  • Index Cond: (((accounttype)::text = 'Google'::text) AND ((accountid)::text = '133-941-2293'::text))
  • Filter: ((NOT (hashed SubPlan 3)) AND (upper((classification)::text) = 'SEGMENT'::text) AND (upper((identifier)::text) = 'PMMPERFTEST1MGOGLE'::text) AND ((((action)::text = 'ADD'::text) AND ((status)::text = 'SUCCESS'::text)) OR
10.          

SubPlan (forIndex Scan)

11. 0.000 0.000 ↓ 0.0 0

Seq Scan on mktsegpmmperftest1mgogle mktsegpmmperftest1mgogle_1 (cost=0.00..16,290.00 rows=1,000,000 width=11) (never executed)

Planning time : 0.556 ms
Execution time : 2,726.483 ms