explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qUi : select * from customer_summary_dynamic

Settings
# exclusive inclusive rows x rows loops node
1. 6.274 1,215.634 ↑ 1.0 13,528 1

Merge Left Join (cost=93,685.08..95,633.90 rows=13,528 width=116) (actual time=1,162.677..1,215.634 rows=13,528 loops=1)

  • Merge Cond: (public.customer.id = journal_summary.customer_id)
2. 4.645 335.069 ↑ 1.0 13,528 1

Merge Left Join (cost=47,987.21..49,817.06 rows=13,528 width=52) (actual time=289.386..335.069 rows=13,528 loops=1)

  • Merge Cond: (public.customer.id = booking_summary.customer_id)
3. 6.311 64.592 ↑ 1.0 13,528 1

Merge Join (cost=2,527.40..4,256.27 rows=13,528 width=36) (actual time=24.485..64.592 rows=13,528 loops=1)

  • Merge Cond: (public.customer.id = public.customer.id)
4. 29.540 54.876 ↑ 1.0 13,528 1

GroupAggregate (cost=2,527.40..2,865.60 rows=13,528 width=633) (actual time=24.470..54.876 rows=13,528 loops=1)

5. 6.124 25.336 ↑ 1.0 13,528 1

Sort (cost=2,527.40..2,561.22 rows=13,528 width=633) (actual time=24.442..25.336 rows=13,528 loops=1)

  • Sort Key: public.customer.id
  • Sort Method: quicksort Memory: 2079kB
6. 5.778 19.212 ↑ 1.0 13,528 1

Hash Left Join (cost=634.38..1,599.13 rows=13,528 width=633) (actual time=12.032..19.212 rows=13,528 loops=1)

  • Hash Cond: (public.customer.id = contact.customer_id)
7. 1.429 1.429 ↑ 1.0 13,528 1

Seq Scan on customer (cost=0.00..677.28 rows=13,528 width=31) (actual time=0.008..1.429 rows=13,528 loops=1)

8. 6.058 12.005 ↑ 1.0 13,528 1

Hash (cost=465.28..465.28 rows=13,528 width=606) (actual time=12.005..12.005 rows=13,528 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 750kB
9. 5.947 5.947 ↑ 1.0 13,528 1

Seq Scan on contact (cost=0.00..465.28 rows=13,528 width=606) (actual time=0.008..5.947 rows=13,528 loops=1)

10. 3.405 3.405 ↑ 1.0 13,528 1

Index Scan using customer_pkey on customer (cost=0.00..1,052.47 rows=13,528 width=4) (actual time=0.012..3.405 rows=13,528 loops=1)

11. 4.084 265.832 ↓ 2.2 9,727 1

Sort (cost=45,459.81..45,471.00 rows=4,477 width=20) (actual time=264.897..265.832 rows=9,727 loops=1)

  • Sort Key: booking_summary.customer_id
  • Sort Method: quicksort Memory: 1144kB
12. 0.805 261.748 ↓ 2.2 9,727 1

Subquery Scan on booking_summary (cost=45,098.78..45,188.32 rows=4,477 width=20) (actual time=259.056..261.748 rows=9,727 loops=1)

13. 180.300 260.943 ↓ 2.2 9,727 1

HashAggregate (cost=45,098.78..45,143.55 rows=4,477 width=17) (actual time=259.056..260.943 rows=9,727 loops=1)

14. 80.643 80.643 ↑ 1.0 524,286 1

Seq Scan on booking (cost=0.00..38,536.68 rows=524,968 width=17) (actual time=0.025..80.643 rows=524,286 loops=1)

15. 5.612 874.291 ↓ 2.1 11,895 1

Sort (cost=45,697.87..45,712.06 rows=5,677 width=68) (actual time=873.279..874.291 rows=11,895 loops=1)

  • Sort Key: journal_summary.customer_id
  • Sort Method: quicksort Memory: 959kB
16. 0.974 868.679 ↓ 2.1 11,895 1

Subquery Scan on journal_summary (cost=45,230.34..45,343.88 rows=5,677 width=68) (actual time=864.282..868.679 rows=11,895 loops=1)

17. 755.651 867.705 ↓ 2.1 11,895 1

HashAggregate (cost=45,230.34..45,287.11 rows=5,677 width=18) (actual time=864.282..867.705 rows=11,895 loops=1)

18. 112.054 112.054 ↑ 1.0 1,268,991 1

Seq Scan on customer_journal (cost=0.00..35,712.91 rows=1,268,991 width=18) (actual time=0.028..112.054 rows=1,268,991 loops=1)

Total runtime : 1,217.190 ms