explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C3Lz

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 56.191 ↑ 1.0 1 1

GroupAggregate (cost=41,266.85..41,266.87 rows=1 width=50) (actual time=56.190..56.191 rows=1 loops=1)

  • Group Key: subdeals.dealership_id, subdeals.dms_cust_no
2. 0.016 56.179 ↑ 1.0 1 1

Sort (cost=41,266.85..41,266.85 rows=1 width=18) (actual time=56.179..56.179 rows=1 loops=1)

  • Sort Key: subdeals.dealership_id, subdeals.dms_cust_no
  • Sort Method: quicksort Memory: 25kB
3. 0.001 56.163 ↑ 1.0 1 1

Subquery Scan on subdeals (cost=41,266.79..41,266.84 rows=1 width=18) (actual time=56.163..56.163 rows=1 loops=1)

4. 0.035 56.162 ↑ 1.0 1 1

GroupAggregate (cost=41,266.79..41,266.83 rows=1 width=34) (actual time=56.162..56.162 rows=1 loops=1)

  • Group Key: deal.dealership_id, ev.dms_cust_no, (date_part('year'::text, ev.event_tstamp)), (date_part('month'::text, ev.event_tstamp))
5. 0.019 56.127 ↑ 1.0 1 1

Sort (cost=41,266.79..41,266.80 rows=1 width=42) (actual time=56.126..56.127 rows=1 loops=1)

  • Sort Key: ev.dms_cust_no, (date_part('year'::text, ev.event_tstamp)), (date_part('month'::text, ev.event_tstamp))
  • Sort Method: quicksort Memory: 25kB
6. 11.612 56.108 ↑ 1.0 1 1

Hash Right Join (cost=13,942.43..41,266.78 rows=1 width=42) (actual time=47.562..56.108 rows=1 loops=1)

  • Hash Cond: ((ev.dealership_id = deal.dealership_id) AND (ev.event_id = deal.event_id))
  • Filter: ((ev.dms_cust_no = '73'::text) OR (deal.cobuyer_dms_cust_no = '73'::text))
  • Rows Removed by Filter: 9992
7. 28.756 28.756 ↓ 2.3 30,009 1

Index Scan using "Event_pkey_2" on "Event" ev (cost=0.43..27,226.53 rows=13,043 width=34) (actual time=0.024..28.756 rows=30,009 loops=1)

  • Index Cond: (dealership_id = 409)
8. 4.342 15.740 ↓ 1.1 9,993 1

Hash (cost=13,802.92..13,802.92 rows=9,272 width=42) (actual time=15.740..15.740 rows=9,993 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 795kB
9. 10.010 11.398 ↓ 1.1 9,993 1

Bitmap Heap Scan on "Deal" deal (cost=260.28..13,802.92 rows=9,272 width=42) (actual time=1.505..11.398 rows=9,993 loops=1)

  • Recheck Cond: (dealership_id = 409)
  • Heap Blocks: exact=471
10. 1.388 1.388 ↓ 1.1 9,993 1

Bitmap Index Scan on "Deal_pkey_2" (cost=0.00..257.96 rows=9,272 width=0) (actual time=1.388..1.388 rows=9,993 loops=1)

  • Index Cond: (dealership_id = 409)