explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XdVN

Settings
# exclusive inclusive rows x rows loops node
1. 0.696 43.391 ↑ 1.4 605 1

Unique (cost=59,999.44..60,028.87 rows=841 width=159) (actual time=42.592..43.391 rows=605 loops=1)

  • Output: a.id, a.pricingplan_id, a.name, a.priceoverridetype, a.merchandise_id, m.description, m.licensetype, slp.startdate, lp.license_id, lp.partner_id, lp.enddate, lp.created, (CASE WHEN (lp.partner_id = 1,652,472) THEN true ELSE false END)
2. 3.000 42.695 ↓ 2.8 2,330 1

Sort (cost=59,999.44..60,001.54 rows=841 width=159) (actual time=42.591..42.695 rows=2,330 loops=1)

  • Output: a.id, a.pricingplan_id, a.name, a.priceoverridetype, a.merchandise_id, m.description, m.licensetype, slp.startdate, lp.license_id, lp.partner_id, lp.enddate, lp.created, (CASE WHEN (lp.partner_id = 1,652,472) THEN true ELSE false END)
  • Sort Key: a.id, a.pricingplan_id, a.name, a.priceoverridetype, a.merchandise_id, m.description, m.licensetype, slp.startdate, lp.license_id, lp.partner_id, lp.enddate, lp.created, (CASE WHEN (lp.partner_id = 1,652,472) THEN true ELSE false END)
  • Sort Method: quicksort Memory: 714kB
3. 2.478 39.695 ↓ 2.8 2,330 1

Gather (cost=2,662.43..59,958.58 rows=841 width=159) (actual time=14.453..39.695 rows=2,330 loops=1)

  • Output: a.id, a.pricingplan_id, a.name, a.priceoverridetype, a.merchandise_id, m.description, m.licensetype, slp.startdate, lp.license_id, lp.partner_id, lp.enddate, lp.created, (CASE WHEN (lp.partner_id = 1,652,472) THEN true ELSE false END)
  • Workers Planned: 1
  • Workers Launched: 1
4. 0.532 37.217 ↓ 2.4 1,165 2 / 2

Hash Join (cost=1,662.43..58,873.62 rows=495 width=159) (actual time=14.396..37.217 rows=1,165 loops=2)

  • Output: a.id, a.pricingplan_id, a.name, a.priceoverridetype, a.merchandise_id, m.description, m.licensetype, slp.startdate, lp.license_id, lp.partner_id, lp.enddate, lp.created, CASE WHEN (lp.partner_id = 1,652,472) THEN true ELSE false END
  • Inner Unique: true
  • Hash Cond: (a.merchandise_id = m.id)
  • Worker 0: actual time=14.850..36.419 rows=1,093 loops=1
5. 0.000 23.008 ↓ 2.4 1,165 2 / 2

Nested Loop (cost=68.57..57,277.22 rows=495 width=81) (actual time=0.524..23.008 rows=1,165 loops=2)

  • Output: a.id, a.pricingplan_id, a.name, a.priceoverridetype, a.merchandise_id, lp.license_id, lp.partner_id, lp.enddate, lp.created, slp.startdate
  • Join Filter: (p.account_id = slp.account_id)
  • Worker 0: actual time=0.072..21.311 rows=1,093 loops=1
6. 0.780 10.402 ↓ 2.4 1,165 2 / 2

Nested Loop (cost=68.00..23,711.88 rows=495 width=81) (actual time=0.505..10.402 rows=1,165 loops=2)

  • Output: a.id, a.pricingplan_id, a.name, a.priceoverridetype, a.merchandise_id, p.account_id, lp.license_id, lp.partner_id, lp.enddate, lp.created
  • Inner Unique: true
  • Worker 0: actual time=0.044..9.233 rows=1,093 loops=1
7. 1.174 7.292 ↓ 2.4 1,165 2 / 2

Nested Loop (cost=67.43..21,097.69 rows=495 width=58) (actual time=0.496..7.292 rows=1,165 loops=2)

  • Output: a.id, a.pricingplan_id, a.name, a.priceoverridetype, a.merchandise_id, a.latestperiod_id, p.account_id
  • Inner Unique: true
  • Worker 0: actual time=0.034..6.329 rows=1,093 loops=1
8. 1.280 1.631 ↓ 1.6 2,244 2 / 2

Parallel Bitmap Heap Scan on public.period p (cost=66.99..9,375.27 rows=1,398 width=8) (actual time=0.482..1.631 rows=2,244 loops=2)

  • Output: p.id, p.created, p.startdate, p.enddate, p.months, p.productid, p.current, p.referencenumber, p.invoice_id, p.account_id, p.license_id, p.orderable_id, p.previousperiod_id, p.autoquoted, p.partner_id, p.renewreminded, p.pricingplan_id, p.productfeatureusage_id, p.dbmodified, p.renewalpricingplan_id, p.anchor, p.migrationevaluation_id
  • Recheck Cond: (p.partner_id = 1,652,472)
  • Heap Blocks: exact=1,088
  • Worker 0: actual time=0.020..1.073 rows=2,058 loops=1
9. 0.351 0.351 ↓ 2.0 4,647 1 / 2

Bitmap Index Scan on period_partner_id (cost=0.00..66.40 rows=2,377 width=0) (actual time=0.703..0.703 rows=4,647 loops=1)

  • Index Cond: (p.partner_id = 1,652,472)
10. 4.487 4.487 ↑ 1.0 1 4,487 / 2

Index Scan using account_pkey on public.account a (cost=0.44..8.39 rows=1 width=50) (actual time=0.002..0.002 rows=1 loops=4,487)

  • Output: a.id, a.name, a.autorenew, a.productid, a.domain, a.creditcarddata_id, a.merchandise_id, a.isjplicense, a.currentunits, a.latestperiod_id, a.status, a.unitusdoverridepriceextax, a.priceoverrideenddate, a.dbmodified, a.actualdomain, a.parent_id, a.renewalaction, a.externaluuid, a.pricingplan_id, a.createexternalaccount, a.warnbeforerenewal, a.priceoverridetype, a.archived, a.billing_group_id, a.transaction_account_billing_group_id, a.latestprovisioningoverrideperiod_id
  • Index Cond: (a.id = p.account_id)
  • Filter: ((a.parent_id IS NULL) AND ((a.status)::text = 'ACTIVE'::text))
  • Rows Removed by Filter: 0
  • Worker 0: actual time=0.002..0.002 rows=1 loops=2,058
11. 2.330 2.330 ↑ 1.0 1 2,330 / 2

Index Scan using period_pkey on public.period lp (cost=0.57..5.28 rows=1 width=39) (actual time=0.002..0.002 rows=1 loops=2,330)

  • Output: lp.id, lp.created, lp.startdate, lp.enddate, lp.months, lp.productid, lp.current, lp.referencenumber, lp.invoice_id, lp.account_id, lp.license_id, lp.orderable_id, lp.previousperiod_id, lp.autoquoted, lp.partner_id, lp.renewreminded, lp.pricingplan_id, lp.productfeatureusage_id, lp.dbmodified, lp.renewalpricingplan_id, lp.anchor, lp.migrationevaluation_id
  • Index Cond: (lp.id = a.latestperiod_id)
  • Worker 0: actual time=0.002..0.002 rows=1 loops=1,093
12. 12.815 12.815 ↑ 5.0 1 2,330 / 2

Index Scan using period_account_id on public.period slp (cost=0.57..67.75 rows=5 width=16) (actual time=0.010..0.011 rows=1 loops=2,330)

  • Output: slp.id, slp.created, slp.startdate, slp.enddate, slp.months, slp.productid, slp.current, slp.referencenumber, slp.invoice_id, slp.account_id, slp.license_id, slp.orderable_id, slp.previousperiod_id, slp.autoquoted, slp.partner_id, slp.renewreminded, slp.pricingplan_id, slp.productfeatureusage_id, slp.dbmodified, slp.renewalpricingplan_id, slp.anchor, slp.migrationevaluation_id
  • Index Cond: (slp.account_id = a.id)
  • Filter: (slp.previousperiod_id IS NULL)
  • Rows Removed by Filter: 19
  • Worker 0: actual time=0.011..0.011 rows=1 loops=1,093
13. 7.518 13.677 ↑ 1.0 37,192 2 / 2

Hash (cost=1,128.94..1,128.94 rows=37,194 width=85) (actual time=13.677..13.677 rows=37,192 loops=2)

  • Output: m.description, m.licensetype, m.id
  • Buckets: 65,536 Batches: 1 Memory Usage: 4,861kB
  • Worker 0: actual time=14.444..14.444 rows=37,192 loops=1
14. 6.159 6.159 ↑ 1.0 37,192 2 / 2

Seq Scan on public.merchandise m (cost=0.00..1,128.94 rows=37,194 width=85) (actual time=0.008..6.159 rows=37,192 loops=2)

  • Output: m.description, m.licensetype, m.id
  • Worker 0: actual time=0.009..5.971 rows=37,192 loops=1
Planning time : 1.141 ms
Execution time : 43.670 ms