explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FPs1

Settings
# exclusive inclusive rows x rows loops node
1. 881.271 5,635.112 ↑ 1.4 109,919 1

Sort (cost=119,125.71..119,509.91 rows=153,683 width=280) (actual time=5,524.169..5,635.112 rows=109,919 loops=1)

  • Sort Key: x2."serviceDate", x2.id
  • Sort Method: quicksort Memory: 32527kB
2. 425.472 4,753.841 ↑ 1.4 109,919 1

HashAggregate (cost=104,349.40..105,886.23 rows=153,683 width=280) (actual time=4,598.987..4,753.841 rows=109,919 loops=1)

  • Group Key: x2.id
3. 573.273 4,328.369 ↑ 2.1 157,071 1

Nested Loop (cost=20,119.57..103,543.13 rows=322,508 width=280) (actual time=449.288..4,328.369 rows=157,071 loops=1)

  • Join Filter: (x2."apptId" = x3.id)
4. 371.733 3,126.812 ↓ 2.6 157,071 1

Hash Join (cost=20,119.15..75,914.72 rows=60,020 width=296) (actual time=449.243..3,126.812 rows=157,071 loops=1)

  • Hash Cond: (x4."doctorId" = x5.id)
5. 868.412 2,753.903 ↑ 1.2 223,138 1

Merge Join (cost=20,016.01..74,194.67 rows=271,122 width=312) (actual time=448.056..2,753.903 rows=223,138 loops=1)

  • Merge Cond: (x4."apptId" = x2."apptId")
6. 1,190.065 1,190.065 ↑ 8.9 468,119 1

Index Scan using "slotToApptFkIdx" on slots x4 (cost=0.43..452,982.24 rows=4,158,068 width=32) (actual time=0.008..1,190.065 rows=468,119 loops=1)

7. 505.674 695.426 ↓ 1.5 223,235 1

Sort (cost=20,010.31..20,394.52 rows=153,683 width=280) (actual time=447.404..695.426 rows=223,235 loops=1)

  • Sort Key: x2."apptId
  • Sort Method: quicksort Memory: 47375kB
8. 189.752 189.752 ↓ 1.0 153,686 1

Seq Scan on bills x2 (cost=0.00..6,770.83 rows=153,683 width=280) (actual time=0.014..189.752 rows=153,686 loops=1)

9. 0.382 1.176 ↓ 1.0 446 1

Hash (cost=97.67..97.67 rows=437 width=16) (actual time=1.175..1.176 rows=446 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
10. 0.794 0.794 ↓ 1.0 446 1

Seq Scan on doctors x5 (cost=0.00..97.67 rows=437 width=16) (actual time=0.009..0.794 rows=446 loops=1)

  • Filter: ("practiceId" = '5bdaef44-8ff0-439f-99d7-3285afcc6911'::uuid)
  • Rows Removed by Filter: 1542
11. 628.284 628.284 ↑ 1.0 1 157,071

Index Only Scan using appointments_pkey on appts x3 (cost=0.42..0.45 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=157,071)

  • Index Cond: (id = x4."apptId")
  • Heap Fetches: 14822
Planning time : 1.068 ms
Execution time : 5,723.630 ms