explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QUfW

Settings
# exclusive inclusive rows x rows loops node
1. 0.104 2,919.981 ↑ 1.0 1 1

Index Scan using pim_individual_pk on public.pim_individual (cost=478,434.86..478,442.88 rows=1 width=45) (actual time=2,919.980..2,919.981 rows=1 loops=1)

  • Output: concat_ws(' '::text, pim_individual.surname, pim_individual.name, pim_individual.patr_name)
  • Index Cond: (pim_individual.id = $2)
  • Buffers: shared hit=179,212 read=187,526
  • I/O Timings: read=1,406.603
2.          

Initplan (for Index Scan)

3. 0.004 2,919.877 ↑ 1.0 1 1

Limit (cost=478,434.43..478,434.43 rows=1 width=40) (actual time=2,919.875..2,919.877 rows=1 loops=1)

  • Output: (((appointment.delta -> 'customer_id'::text))::integer), appointment.aud_when
  • Buffers: shared hit=179,208 read=187,526
  • I/O Timings: read=1,406.603
4.          

CTE audit_rec

5. 0.000 0.000 ↓ 0.0 0

Index Scan using "public$md_appointment_pk" on audit."public$md_appointment" (cost=0.43..8.45 rows=1 width=572) (never executed)

  • Output: "public$md_appointment".aud_rec, "public$md_appointment".id, "public$md_appointment".type, "public$md_appointment".delta_deprecated, "public$md_appointment".aud_when, "public$md_appointment".aud_who, "public$md_appointment".aud_so (...)
  • Index Cond: ("public$md_appointment".aud_rec = 23,111,680)
6.          

Initplan (for Limit)

7. 0.000 0.000 ↓ 0.0 0

CTE Scan on audit_rec (cost=0.00..0.02 rows=1 width=8) (never executed)

  • Output: audit_rec.aud_when
8. 0.018 2,919.873 ↑ 11.0 1 1

Sort (cost=478,425.96..478,425.99 rows=11 width=40) (actual time=2,919.873..2,919.873 rows=1 loops=1)

  • Output: (((appointment.delta -> 'customer_id'::text))::integer), appointment.aud_when
  • Sort Key: appointment.aud_when
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=179,208 read=187,526
  • I/O Timings: read=1,406.603
9. 2,919.855 2,919.855 ↑ 11.0 1 1

Seq Scan on audit."public$md_appointment" appointment (cost=0.00..478,425.91 rows=11 width=40) (actual time=1,362.801..2,919.855 rows=1 loops=1)

  • Output: ((appointment.delta -> 'customer_id'::text))::integer, appointment.aud_when
  • Filter: (((appointment.delta -> 'customer_id'::text) IS NOT NULL) AND (appointment.id = 9,883,585) AND (((appointment.type = 'U'::text) AND (appointment.aud_when < $1)) OR (appointment.type = 'I'::text)))
  • Rows Removed by Filter: 4,804,756
  • Buffers: shared hit=179,208 read=187,526
  • I/O Timings: read=1,406.603
Planning time : 0.760 ms
Execution time : 2,920.125 ms