explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WYon

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 354,228.653 ↑ 1.0 1 1

Limit (cost=102,787.97..102,787.98 rows=1 width=8) (actual time=354,228.652..354,228.653 rows=1 loops=1)

2. 7.269 354,228.652 ↑ 1.0 1 1

Aggregate (cost=102,787.97..102,787.98 rows=1 width=8) (actual time=354,228.652..354,228.652 rows=1 loops=1)

3. 8.198 354,221.383 ↓ 1,563.3 26,576 1

Nested Loop (cost=25,932.68..102,787.93 rows=17 width=0) (actual time=323,131.918..354,221.383 rows=26,576 loops=1)

4. 0.012 0.101 ↓ 2.0 2 1

Nested Loop (cost=0.29..36.75 rows=1 width=23) (actual time=0.075..0.101 rows=2 loops=1)

  • Join Filter: (t.poluch_id = p.poluch_id)
  • Rows Removed by Join Filter: 6
5. 0.005 0.079 ↓ 2.0 2 1

Nested Loop (cost=0.29..35.66 rows=1 width=28) (actual time=0.070..0.079 rows=2 loops=1)

6. 0.052 0.052 ↑ 1.0 1 1

Index Scan using dc_organization_adm_legacy_id_un on dc_organization dc (cost=0.29..34.59 rows=1 width=10) (actual time=0.051..0.052 rows=1 loops=1)

  • Index Cond: (adm_legacy_id IS NOT NULL)
  • Filter: ((code)::text = '45597'::text)
  • Rows Removed by Filter: 3
7. 0.022 0.022 ↓ 2.0 2 1

Seq Scan on kvit_splat t (cost=0.00..1.06 rows=1 width=26) (actual time=0.016..0.022 rows=2 loops=1)

  • Filter: (((ogai_kod)::text = '45597'::text) AND (uslug_id = '204'::numeric))
  • Rows Removed by Filter: 2
8. 0.010 0.010 ↑ 1.0 4 2

Seq Scan on kvit_spoluch p (cost=0.00..1.04 rows=4 width=6) (actual time=0.002..0.005 rows=4 loops=2)

9. 292,662.847 354,213.084 ↓ 3.9 13,288 2

Bitmap Heap Scan on docs_executive e (cost=25,932.40..102,717.29 rows=3,389 width=14) (actual time=161,565.515..177,106.542 rows=13,288 loops=2)

  • Recheck Cond: ((((status_id = '3'::numeric) AND ((ogai_sost_kod)::text = '45597'::text)) OR ((status_id = '4'::numeric) AND ((ogai_sost_kod)::text = '45597'::text))) AND (dat_sost >= trunc(t.date_from, 'DDD'::text)))
  • Rows Removed by Index Recheck: 133,654
  • Filter: ((dat_sost <= COALESCE(trunc(t.date_end, 'DDD'::text), dat_sost)) AND ((status_id = '3'::numeric) OR ((status_id = '4'::numeric) AND (alternatives: SubPlan 1 or hashed SubPlan 2))))
  • Rows Removed by Filter: 77,796
  • Heap Blocks: exact=115,807 lossy=89,194
10. 48.798 51,567.074 ↓ 0.0 0 2

BitmapAnd (cost=25,932.40..25,932.40 rows=19,011 width=0) (actual time=25,783.537..25,783.537 rows=0 loops=2)

11. 0.002 12,928.494 ↓ 0.0 0 2

BitmapOr (cost=1,029.24..1,029.24 rows=57,033 width=0) (actual time=6,464.247..6,464.247 rows=0 loops=2)

12. 2,573.076 2,573.076 ↓ 8.8 35,745 2

Bitmap Index Scan on docs_executive_status_id_kod (cost=0.00..73.55 rows=4,072 width=0) (actual time=1,286.538..1,286.538 rows=35,745 loops=2)

  • Index Cond: ((status_id = '3'::numeric) AND ((ogai_sost_kod)::text = '45597'::text))
13. 10,355.416 10,355.416 ↓ 2.8 150,572 2

Bitmap Index Scan on docs_executive_status_id_kod (cost=0.00..940.44 rows=52,961 width=0) (actual time=5,177.708..5,177.708 rows=150,572 loops=2)

  • Index Cond: ((status_id = '4'::numeric) AND ((ogai_sost_kod)::text = '45597'::text))
14. 38,589.782 38,589.782 ↓ 1.8 2,477,900 2

Bitmap Index Scan on docs_executive_dat_sost (cost=0.00..24,902.06 rows=1,413,336 width=0) (actual time=19,294.891..19,294.891 rows=2,477,900 loops=2)

  • Index Cond: (dat_sost >= trunc(t.date_from, 'DDD'::text))
15.          

SubPlan (for Bitmap Heap Scan)

16. 9,983.163 9,983.163 ↓ 0.0 0 114,749

Index Only Scan using docs_executive_response_idx1 on docs_executive_response r (cost=0.42..2.85 rows=1 width=0) (actual time=0.087..0.087 rows=0 loops=114,749)

  • Index Cond: ((docs_id = e.docs_id) AND (docs_type = '1'::numeric) AND (process_status = '-1'::numeric))
  • Heap Fetches: 0
17. 0.000 0.000 ↓ 0.0 0

Index Only Scan using docs_executive_response_idx1 on docs_executive_response r_1 (cost=0.42..16,983.58 rows=11,691 width=6) (never executed)

  • Index Cond: ((docs_type = '1'::numeric) AND (process_status = '-1'::numeric))
  • Heap Fetches: 0
Planning time : 0.758 ms
Execution time : 354,229.838 ms