explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Qfm4

Settings
# exclusive inclusive rows x rows loops node
1. 3.940 1,041.840 ↑ 2.0 1,484 1

Sort (cost=820.74..828.29 rows=3,022 width=327) (actual time=1,041.742..1,041.840 rows=1,484 loops=1)

  • Sort Key: core_labtest.name
  • Sort Method: quicksort Memory: 773kB
2. 728.762 1,037.900 ↑ 2.0 1,484 1

HashAggregate (cost=615.83..646.05 rows=3,022 width=327) (actual time=1,037.379..1,037.900 rows=1,484 loops=1)

  • Group Key: core_labtest.name, core_labtest.id, core_labtest.created_at, core_labtest.updated_at, core_labtest.msrp_price, core_labtest.rupa_price, core_labtest.initial_insurance_price, core_labtest.url, core_labtest.image, core_labtest.details, core_labtest.internal_notes, core_labtest.cheatsheet_url, core_labtest.labs_external_test_id, core_labtest.unavailable_reason, core_labtest.vibrant_minimum_excluded, core_labtest.lab_company_id, core_labtest.shipping_days_min_override, core_labtest.shipping_days_max_override
3. 145.382 309.138 ↓ 120.5 581,904 1

Hash Left Join (cost=205.69..398.48 rows=4,830 width=327) (actual time=2.874..309.138 rows=581,904 loops=1)

  • Hash Cond: (core_practitioner_registered_lab_companies.practitioner_id = core_practitioner.id)
  • Filter: (core_labcompany.public OR (core_practitioner.user_id = 140))
  • Rows Removed by Filter: 15
4. 159.949 163.628 ↓ 114.1 581,919 1

Hash Right Join (cost=184.75..364.02 rows=5,098 width=332) (actual time=2.739..163.628 rows=581,919 loops=1)

  • Hash Cond: (core_practitioner_registered_lab_companies.labcompany_id = core_labcompany.id)
5. 0.952 0.952 ↑ 1.0 6,621 1

Seq Scan on core_practitioner_registered_lab_companies (cost=0.00..104.37 rows=6,737 width=8) (actual time=0.006..0.952 rows=6,621 loops=1)

6. 0.743 2.727 ↓ 106.0 1,484 1

Hash (cost=184.58..184.58 rows=14 width=332) (actual time=2.727..2.727 rows=1,484 loops=1)

  • Buckets: 2,048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 550kB
7. 0.315 1.984 ↓ 106.0 1,484 1

Hash Join (cost=143.36..184.58 rows=14 width=332) (actual time=1.271..1.984 rows=1,484 loops=1)

  • Hash Cond: (core_labtest.lab_company_id = core_labcompany.id)
8. 0.413 1.652 ↓ 106.0 1,484 1

Hash Right Join (cost=141.93..183.10 rows=14 width=327) (actual time=1.251..1.652 rows=1,484 loops=1)

  • Hash Cond: (core_labtest_restricted_practitioners.labtest_id = core_labtest.id)
  • Filter: ((t7.user_id = 140) OR (core_labtest_restricted_practitioners.practitioner_id IS NULL))
  • Rows Removed by Filter: 35
9. 0.013 0.154 ↑ 58.3 35 1

Hash Left Join (cost=20.93..56.73 rows=2,040 width=12) (actual time=0.145..0.154 rows=35 loops=1)

  • Hash Cond: (core_labtest_restricted_practitioners.practitioner_id = t7.id)
10. 0.007 0.007 ↑ 58.3 35 1

Seq Scan on core_labtest_restricted_practitioners (cost=0.00..30.40 rows=2,040 width=8) (actual time=0.004..0.007 rows=35 loops=1)

11. 0.053 0.134 ↑ 1.0 486 1

Hash (cost=14.86..14.86 rows=486 width=8) (actual time=0.134..0.134 rows=486 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 27kB
12. 0.081 0.081 ↑ 1.0 486 1

Seq Scan on core_practitioner t7 (cost=0.00..14.86 rows=486 width=8) (actual time=0.005..0.081 rows=486 loops=1)

13. 0.586 1.085 ↑ 1.0 1,511 1

Hash (cost=102.11..102.11 rows=1,511 width=327) (actual time=1.085..1.085 rows=1,511 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 552kB
14. 0.499 0.499 ↑ 1.0 1,511 1

Seq Scan on core_labtest (cost=0.00..102.11 rows=1,511 width=327) (actual time=0.004..0.499 rows=1,511 loops=1)

15. 0.005 0.017 ↑ 1.0 19 1

Hash (cost=1.19..1.19 rows=19 width=5) (actual time=0.016..0.017 rows=19 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
16. 0.012 0.012 ↑ 1.0 19 1

Seq Scan on core_labcompany (cost=0.00..1.19 rows=19 width=5) (actual time=0.009..0.012 rows=19 loops=1)

17. 0.061 0.128 ↑ 1.0 486 1

Hash (cost=14.86..14.86 rows=486 width=8) (actual time=0.128..0.128 rows=486 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 27kB
18. 0.067 0.067 ↑ 1.0 486 1

Seq Scan on core_practitioner (cost=0.00..14.86 rows=486 width=8) (actual time=0.003..0.067 rows=486 loops=1)