explain.depesz.com

PostgreSQL's explain analyze made readable

Result: E7sG : q3

Settings
# exclusive inclusive rows x rows loops node
1. 15.400 4,448.370 ↑ 2.0 133,535 1

Nested Loop (cost=10.59..2,790,538.56 rows=272,065 width=99) (actual time=0.117..4,448.370 rows=133,535 loops=1)

2. 5.610 3,497.952 ↑ 2.0 133,574 1

Nested Loop (cost=6.88..1,776,955.49 rows=272,065 width=83) (actual time=0.067..3,497.952 rows=133,574 loops=1)

3. 74.824 2,006.032 ↑ 1.8 148,631 1

Nested Loop (cost=3.14..750,590.50 rows=272,065 width=79) (actual time=0.051..2,006.032 rows=148,631 loops=1)

4. 26.683 26.683 ↓ 1.0 272,075 1

Index Only Scan using person_pkey on person p (cost=0.42..5,132.40 rows=272,065 width=13) (actual time=0.012..26.683 rows=272,075 loops=1)

  • Heap Fetches: 155
5. 0.000 1,904.525 ↑ 1.0 1 272,075

Limit (cost=2.71..2.72 rows=1 width=70) (actual time=0.007..0.007 rows=1 loops=272,075)

6. 272.075 1,904.525 ↑ 1.0 1 272,075

Sort (cost=2.71..2.72 rows=1 width=70) (actual time=0.007..0.007 rows=1 loops=272,075)

  • Sort Key: (displayrow(pn.effectivedate, pn.enddate))
  • Sort Method: quicksort Memory: 25kB
7. 1,632.450 1,632.450 ↑ 1.0 1 272,075

Index Scan using personnamepersonidnametype on person_names pn (cost=0.42..2.71 rows=1 width=70) (actual time=0.006..0.006 rows=1 loops=272,075)

  • Index Cond: ((personid = p.personid) AND (nametype = 'Legal'::bpchar))
  • Filter: ((effectivedate <= enddate) AND (CURRENT_TIMESTAMP >= createts) AND (CURRENT_TIMESTAMP <= endts))
  • Rows Removed by Filter: 0
8. 148.631 1,486.310 ↑ 1.0 1 148,631

Limit (cost=3.75..3.75 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=148,631)

9. 0.000 1,337.679 ↑ 1.0 1 148,631

Sort (cost=3.75..3.75 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=148,631)

  • Sort Key: (displayrow(pp.effectivedate, pp.enddate))
  • Sort Method: quicksort Memory: 25kB
10. 1,337.679 1,337.679 ↑ 1.0 1 148,631

Index Scan using pers_pospersendeff on pers_pos pp (cost=0.42..3.74 rows=1 width=8) (actual time=0.007..0.009 rows=1 loops=148,631)

  • Index Cond: (personid = p.personid)
  • Filter: ((effectivedate <= enddate) AND (persposrel = 'Occupies'::bpchar) AND (CURRENT_TIMESTAMP >= createts) AND (CURRENT_TIMESTAMP <= endts))
  • Rows Removed by Filter: 1
11. 0.000 935.018 ↑ 1.0 1 133,574

Limit (cost=3.70..3.71 rows=1 width=24) (actual time=0.007..0.007 rows=1 loops=133,574)

12. 133.574 935.018 ↑ 1.0 1 133,574

Sort (cost=3.70..3.71 rows=1 width=24) (actual time=0.006..0.007 rows=1 loops=133,574)

  • Sort Key: (displayrow(pd.effectivedate, pd.enddate))
  • Sort Method: quicksort Memory: 25kB
13. 801.444 801.444 ↑ 1.0 1 133,574

Index Scan using pk_position_desc on position_desc pd (cost=0.42..3.69 rows=1 width=24) (actual time=0.005..0.006 rows=1 loops=133,574)

  • Index Cond: (positionid = pp.positionid)
  • Filter: ((effectivedate <= enddate) AND (CURRENT_TIMESTAMP >= createts) AND (CURRENT_TIMESTAMP <= endts))
  • Rows Removed by Filter: 1
Planning time : 0.299 ms
Execution time : 4,455.068 ms