explain.depesz.com

PostgreSQL's explain analyze made readable

Result: K1Vh

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.604 3,483.319 ↓ 0.0 0 1

Update on episodios_alta_diagnosticos (cost=0.42..394,164.74 rows=28 width=26) (actual time=3,483.319..3,483.319 rows=0 loops=1)

2. 0.250 3,482.715 ↓ 1.0 29 1

Index Scan using episodios_alta_diagnosticos_pkey on episodios_alta_diagnosticos episodios_alta_diagnosticos (cost=0.42..394,164.74 rows=28 width=26) (actual time=123.656..3,482.715 rows=29 loops=1)

  • Index Cond: (id < 386655)
3.          

SubPlan (for Index Scan)

4. 0.174 3,482.465 ↑ 1.0 1 29

Limit (cost=14,076.98..14,076.99 rows=1 width=12) (actual time=120.082..120.085 rows=1 loops=29)

5. 668.508 3,482.291 ↑ 34,585.0 1 29

Sort (cost=14,076.98..14,163.45 rows=34,585 width=12) (actual time=120.079..120.079 rows=1 loops=29)

  • Sort Key: (random())
  • Sort Method: top-N heapsort Memory: 25kB
6. 2,374.056 2,813.783 ↓ 2.2 75,695 29

Bitmap Heap Scan on cies cies (cost=1,731.83..13,904.06 rows=34,585 width=12) (actual time=16.735..97.027 rows=75,695 loops=29)

  • Filter: (diagnostico_procedimiento = 'D'::bpchar)
  • Heap Blocks: exact=156,745
7. 439.727 439.727 ↓ 2.5 151,484 29

Bitmap Index Scan on cies_id_cie_version_codigo (cost=0..1,723.18 rows=61,701 width=0) (actual time=15.163..15.163 rows=151,484 loops=29)

  • Index Cond: (CASE WHEN (episodios_alta_diagnosticos.orden > '-1'::integer) THEN 6 ELSE 0 END = id_cie_version)
Planning time : 0.221 ms
Execution time : 3,526.366 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
RI_ConstraintTrigger_c_125443 42.948 ms 29 1.481 ms