explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QYah

Settings
# exclusive inclusive rows x rows loops node
1. 1,812.932 7,686.400 ↑ 1.4 109,916 1

Sort (cost=137,666.39..138,050.58 rows=153,676 width=280) (actual time=7,531.674..7,686.400 rows=109,916 loops=1)

  • Sort Key: x2."serviceDate", x2.id
  • Sort Method: quicksort Memory: 32526kB
2. 747.159 5,873.468 ↑ 1.4 109,916 1

HashAggregate (cost=122,890.80..124,427.56 rows=153,676 width=280) (actual time=5,561.302..5,873.468 rows=109,916 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. 692.942 5,126.309 ↑ 2.1 157,068 1

Nested Loop (cost=20,118.85..103,541.22 rows=322,493 width=280) (actual time=422.381..5,126.309 rows=157,068 loops=1)

  • Join Filter: (x2."apptId" = x3.id)
4. 416.594 3,648.027 ↓ 2.6 157,068 1

Hash Join (cost=20,118.43..75,913.73 rows=60,018 width=296) (actual time=422.358..3,648.027 rows=157,068 loops=1)

  • Hash Cond: (x4."doctorId" = doctors.id)
5. 1,073.195 3,230.123 ↑ 1.2 223,134 1

Merge Join (cost=20,015.29..74,193.76 rows=271,109 width=312) (actual time=421.028..3,230.123 rows=223,134 loops=1)

  • Merge Cond: (x4."apptId" = x2."apptId")
6. 1,454.384 1,454.384 ↑ 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.008..1,454.384 rows=468,069 loops=1)

7. 517.702 702.544 ↓ 1.5 223,231 1

Sort (cost=20,009.59..20,393.78 rows=153,676 width=280) (actual time=420.982..702.544 rows=223,231 loops=1)

  • Sort Key: x2."apptId
  • Sort Method: quicksort Memory: 47374kB
8. 184.842 184.842 ↓ 1.0 153,682 1

Seq Scan on bills x2 (cost=0.00..6,770.76 rows=153,676 width=280) (actual time=0.013..184.842 rows=153,682 loops=1)

9. 0.376 1.310 ↓ 1.0 446 1

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

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

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

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

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

  • Index Cond: (id = x4."apptId")
  • Heap Fetches: 14760
Planning time : 1.173 ms
Execution time : 7,824.806 ms