explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DuYx : Original count star

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 227.050 2,747.377 ↑ 1.0 1 1

Aggregate (cost=306,358.89..306,358.90 rows=1 width=8) (actual time=2,747.377..2,747.377 rows=1 loops=1)

2. 670.704 2,520.327 ↓ 1.3 1,000,000 1

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

3. 1,020.741 1,849.623 ↓ 1.3 1,000,000 1

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

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

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

5. 334.428 381.205 ↓ 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.802..381.205 rows=1,000,000 loops=1)

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

SubPlan (for Seq Scan)

7. 46.777 46.777 ↓ 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.777..46.777 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))
8. 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))
9. 0.001 46.558 ↓ 0.0 0 1

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

10. 46.557 46.557 ↓ 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.557..46.557 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'::tex
11.          

SubPlan (for Index Scan)

12. 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.455 ms
Execution time : 2,754.322 ms