explain.depesz.com

PostgreSQL's explain analyze made readable

Result: K2pQ : Optimization for: plan #zvcK

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.010 0.490 ↓ 6.0 6 1

Unique (cost=17..17.02 rows=1 width=56) (actual time=0.48..0.49 rows=6 loops=1)

  • Buffers: shared hit=53
2. 0.014 0.480 ↓ 6.0 6 1

Sort (cost=17..17 rows=1 width=56) (actual time=0.479..0.48 rows=6 loops=1)

  • Sort Key: "EmailAddress".cust_num, (count("EmailAddress".email)), "Package".no_of_emails, "AlaCarte".mboxqty, (("Package".no_of_emails + "AlaCarte".mboxqty)), (round((((count("EmailAddress".email))::numeric / (GREATEST("Package".no_of_emails, ("Package".no_of_emails + "AlaCarte".mboxqty)))::numeric) * '100'::numeric), 1))
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=53
3. 0.031 0.466 ↓ 6.0 6 1

Aggregate (cost=16.94..16.99 rows=1 width=56) (actual time=0.447..0.466 rows=6 loops=1)

  • Buffers: shared hit=53
4. 0.025 0.435 ↓ 13.0 13 1

Sort (cost=16.94..16.94 rows=1 width=528) (actual time=0.434..0.435 rows=13 loops=1)

  • Sort Key: "EmailAddress".cust_num, "Package".no_of_emails, "AlaCarte".mboxqty
  • Sort Method: quicksort Memory: 26kB
  • Buffers: shared hit=53
5. 0.103 0.410 ↓ 13.0 13 1

Nested Loop (cost=0.15..16.93 rows=1 width=528) (actual time=0.088..0.41 rows=13 loops=1)

  • Buffers: shared hit=53
6. 0.013 0.281 ↓ 13.0 13 1

Nested Loop (cost=0.15..15.86 rows=1 width=528) (actual time=0.075..0.281 rows=13 loops=1)

  • Buffers: shared hit=40
7. 0.104 0.177 ↓ 13.0 13 1

Nested Loop (cost=0..11.68 rows=1 width=942) (actual time=0.039..0.177 rows=13 loops=1)

  • Buffers: shared hit=14
8. 0.034 0.034 ↓ 13.0 13 1

Seq Scan on EmailAddress EmailAddress (cost=0..10.5 rows=1 width=520) (actual time=0.026..0.034 rows=13 loops=1)

  • Filter: ("EmailAddress".status = 'Active'::bpchar)
  • Buffers: shared hit=1
9. 0.039 0.039 ↑ 1.3 6 13

Seq Scan on Customer Customer (cost=0..1.08 rows=8 width=422) (actual time=0.002..0.003 rows=6 loops=13)

  • Buffers: shared hit=13
10. 0.091 0.091 ↑ 1.0 1 13

Index Scan using "Package_pkey" on Package Package (cost=0.15..4.17 rows=1 width=36) (actual time=0.007..0.007 rows=1 loops=13)

  • Index Cond: ("Package".pkg_id = ("Customer".package)::text)
  • Buffers: shared hit=26
11. 0.026 0.026 ↑ 1.0 3 13

Seq Scan on AlaCarte AlaCarte (cost=0..1.03 rows=3 width=8) (actual time=0.001..0.002 rows=3 loops=13)

  • Buffers: shared hit=13