explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Tofn

Settings
# exclusive inclusive rows x rows loops node
1. 1,989.031 10,324.155 ↑ 1.4 109,917 1

Sort (cost=137,669.92..138,054.12 rows=153,683 width=280) (actual time=10,146.540..10,324.155 rows=109,917 loops=1)

  • Sort Key: x2."serviceDate", x2.id
  • Sort Method: quicksort Memory: 32,526kB
2. 747.131 8,335.124 ↑ 1.4 109,917 1

HashAggregate (cost=122,893.61..124,430.44 rows=153,683 width=280) (actual time=8,141.705..8,335.124 rows=109,917 loops=1)

  • Group Key: x2."serviceDate", x2.id, x2."patientId", x2."apptId", x2."insuranceCoverageId", x2."secondaryInsuranceCoverageId", x2.status, x2.titl, x2."time", x2."statusTime", x2.due, x2."claimSentTime", x2."eligibleReferenceId", x2."paymentScheduledFor", x2."invoiceSentTime", x2.reasons, x2."preferredPaymentMethodId", x2."failedAttempts", x2."externalId", x2."payerControlNumber", x2.reviewed, x2."reviewedBy", x2."syncFailedReason", x2."createdAt
3. 899.752 7,587.993 ↑ 2.1 157,069 1

Nested Loop (cost=20,119.57..103,543.13 rows=322,508 width=280) (actual time=924.400..7,587.993 rows=157,069 loops=1)

  • Join Filter: (x2."apptId" = x3.id)
4. 624.263 5,588.758 ↓ 2.6 157,069 1

Hash Join (cost=20,119.15..75,914.72 rows=60,020 width=296) (actual time=924.368..5,588.758 rows=157,069 loops=1)

  • Hash Cond: (x4."doctorId" = doctors.id)
5. 1,300.168 4,962.514 ↑ 1.2 223,135 1

Merge Join (cost=20,016.01..74,194.67 rows=271,122 width=312) (actual time=922.360..4,962.514 rows=223,135 loops=1)

  • Merge Cond: (x4."apptId" = x2."apptId")
6. 2,357.496 2,357.496 ↑ 8.9 468,069 1

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

7. 954.129 1,304.850 ↓ 1.5 223,232 1

Sort (cost=20,010.31..20,394.52 rows=153,683 width=280) (actual time=922.210..1,304.850 rows=223,232 loops=1)

  • Sort Key: x2."apptId
  • Sort Method: quicksort Memory: 47,374kB
8. 350.721 350.721 ↑ 1.0 153,683 1

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

9. 0.518 1.981 ↓ 1.0 446 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 29kB
10. 1.463 1.463 ↓ 1.0 446 1

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

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

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

  • Index Cond: (id = x4."apptId")
  • Heap Fetches: 14,761
Planning time : 1.984 ms
Execution time : 10,451.486 ms