explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LbOH

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 2,725.523 ↑ 1.0 1 1

Aggregate (cost=109,409.25..109,409.26 rows=1 width=0) (actual time=2,725.522..2,725.523 rows=1 loops=1)

2. 6.477 2,725.502 ↓ 6.0 18 1

Bitmap Heap Scan on health_exams this_ (cost=105,549.67..109,409.25 rows=3 width=0) (actual time=2,719.330..2,725.502 rows=18 loops=1)

  • Recheck Cond: ((((refers_to_institution_id = 73) AND (date_created >= '2018-12-10 00:00:00'::timestamp without time zone) AND (is_active IS TRUE)) OR ((refers_to_institution_id = 73) AND (date_created >= '2019-01-08 00:00:00'::timestamp without time zone) AND (is_active IS TRUE))) AND (refers_to_specialty_id = 203300))
  • Filter: ((is_active IS TRUE) AND (exam_number IS NOT NULL) AND (admission_time IS NULL) AND (exam_status_id = 1) AND (((exam_type = 3) AND (date_created >= '2018-12-10 00:00:00'::timestamp without time zone)) OR ((exam_type = 4) AND (date_created >= '2019-01-08 00:00:00'::timestamp without time zone))))
  • Rows Removed by Filter: 1135
  • Heap Blocks: exact=1171
3. 39.056 2,719.025 ↓ 0.0 0 1

BitmapAnd (cost=105,549.67..105,549.67 rows=965 width=0) (actual time=2,719.025..2,719.025 rows=0 loops=1)

4. 0.001 12.359 ↓ 0.0 0 1

BitmapOr (cost=1,930.54..1,930.54 rows=41,358 width=0) (actual time=12.359..12.359 rows=0 loops=1)

5. 11.906 11.906 ↑ 1.2 34,575 1

Bitmap Index Scan on ix_health_exams_refers_to_institution_id_is_active_date_created (cost=0.00..1,858.13 rows=39,886 width=0) (actual time=11.906..11.906 rows=34,575 loops=1)

  • Index Cond: ((refers_to_institution_id = 73) AND (date_created >= '2018-12-10 00:00:00'::timestamp without time zone) AND (is_active = true))
6. 0.452 0.452 ↓ 1.8 2,657 1

Bitmap Index Scan on ix_health_exams_refers_to_institution_id_is_active_date_created (cost=0.00..72.41 rows=1,472 width=0) (actual time=0.452..0.452 rows=2,657 loops=1)

  • Index Cond: ((refers_to_institution_id = 73) AND (date_created >= '2019-01-08 00:00:00'::timestamp without time zone) AND (is_active = true))
7. 2,667.610 2,667.610 ↑ 1.0 4,073,009 1

Bitmap Index Scan on ix_health_exams_refers_to_specialty_id (cost=0.00..103,618.88 rows=4,211,508 width=0) (actual time=2,667.610..2,667.610 rows=4,073,009 loops=1)

  • Index Cond: (refers_to_specialty_id = 203300)