explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 91s3

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 0.475 ↑ 502,585.1 14 1

Unique (cost=45,788,755.98..46,756,232.30 rows=7,036,191 width=664) (actual time=0.453..0.475 rows=14 loops=1)

2. 0.021 0.453 ↑ 2,512,925.5 14 1

Sort (cost=45,788,755.98..45,876,708.37 rows=35,180,957 width=664) (actual time=0.452..0.453 rows=14 loops=1)

  • Sort Key: changes_0ml.change_id DESC, changes_0ml.change_date, changes_0ml.created_date, changes_0ml.table_name, changes_0ml.model_name, changes_0ml.p_keys, changes_0ml.p_key_vals, changes_0ml.data, changes_0ml.fields, changes_0ml.event_type
  • Sort Method: quicksort Memory: 31kB
3. 0.022 0.432 ↑ 2,512,925.5 14 1

Nested Loop (cost=1,923.47..14,009.57 rows=35,180,957 width=664) (actual time=0.320..0.432 rows=14 loops=1)

4. 0.010 0.312 ↑ 14.3 14 1

HashAggregate (cost=1,923.04..1,925.04 rows=200 width=8) (actual time=0.307..0.312 rows=14 loops=1)

  • Group Key: (unnest(patients_consultation_logs_y2018.change_ids))
5. 0.001 0.302 ↑ 1,600.0 14 1

Append (cost=0.43..1,643.04 rows=22,400 width=8) (actual time=0.285..0.302 rows=14 loops=1)

6. 0.001 0.134 ↓ 0.0 0 1

ProjectSet (cost=0.43..686.50 rows=10,100 width=8) (actual time=0.134..0.134 rows=0 loops=1)

7. 0.133 0.133 ↓ 0.0 0 1

Index Scan using patients_consultation_logs_y201_consultation_id_change_date_key on patients_consultation_logs_y2018 (cost=0.43..635.24 rows=101 width=39) (actual time=0.133..0.133 rows=0 loops=1)

  • Index Cond: (consultation_id = ANY ('{25110274,26576314,25110275,25110273,18621971,18489981,20992670,12026108,10216384,9627605,9627604,10709637,16217124,10239043,11420687,10515090,10499529,10450641,10416783,10250765,11953561,10477960,14249339,14249337,12965050,12789091,12631965,12586907,12531024,12424058,12255754,11953623,11926404,11926312,11926046,11506685,11402264,11133449,11041928,10941931,10905840,10560798,10515439,10455602,10405249,10405190,10247711,10238931,9627606,9627603,9627602,9627572,17191080,15037397,15037391,14359341,14359337,11530804,11530758,11530709,10310075,12705136,12026105,11953344,11546493,11411440,11378855,10953010,10941880,10583486,9795568,9653760,9627570,16217132,12574234,12182966,19403420,30373599,27179607,21964173,21502213}'::integer[]))
8. 0.005 0.167 ↑ 878.6 14 1

ProjectSet (cost=0.43..844.54 rows=12,300 width=8) (actual time=0.151..0.167 rows=14 loops=1)

9. 0.162 0.162 ↑ 41.0 3 1

Index Scan using patients_consultation_logs_y20_consultation_id_change_date_key1 on patients_consultation_logs_y2019 (cost=0.43..782.11 rows=123 width=39) (actual time=0.149..0.162 rows=3 loops=1)

  • Index Cond: (consultation_id = ANY ('{25110274,26576314,25110275,25110273,18621971,18489981,20992670,12026108,10216384,9627605,9627604,10709637,16217124,10239043,11420687,10515090,10499529,10450641,10416783,10250765,11953561,10477960,14249339,14249337,12965050,12789091,12631965,12586907,12531024,12424058,12255754,11953623,11926404,11926312,11926046,11506685,11402264,11133449,11041928,10941931,10905840,10560798,10515439,10455602,10405249,10405190,10247711,10238931,9627606,9627603,9627602,9627572,17191080,15037397,15037391,14359341,14359337,11530804,11530758,11530709,10310075,12705136,12026105,11953344,11546493,11411440,11378855,10953010,10941880,10583486,9795568,9653760,9627570,16217132,12574234,12182966,19403420,30373599,27179607,21964173,21502213}'::integer[]))
10. 0.005 0.098 ↑ 8.0 1 14

Append (cost=0.43..60.34 rows=8 width=663) (actual time=0.007..0.007 rows=1 loops=14)

11. 0.000 0.000 ↓ 0.0 0

Index Scan using changes_0ml_change_id_idx on changes_0ml (cost=0.43..7.62 rows=1 width=674) (never executed)

  • Index Cond: (change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
12. 0.000 0.000 ↓ 0.0 0

Index Scan using changes_1mi_change_id_idx on changes_1mi (cost=0.43..7.62 rows=1 width=663) (never executed)

  • Index Cond: (change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
13. 0.000 0.000 ↓ 0.0 0

Index Scan using changes_2mi_change_id_idx on changes_2mi (cost=0.43..7.63 rows=1 width=664) (never executed)

  • Index Cond: (change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
14. 0.000 0.000 ↓ 0.0 0

Index Scan using changes_3mi_change_id_idx on changes_3mi (cost=0.43..7.62 rows=1 width=661) (never executed)

  • Index Cond: (change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
15. 0.030 0.030 ↑ 1.0 1 5

Index Scan using changes_4mi_change_id_idx on changes_4mi (cost=0.43..7.63 rows=1 width=663) (actual time=0.006..0.006 rows=1 loops=5)

  • Index Cond: (change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
16. 0.063 0.063 ↑ 1.0 1 9

Index Scan using changes_5mi_change_id_idx on changes_5mi (cost=0.43..7.62 rows=1 width=660) (actual time=0.007..0.007 rows=1 loops=9)

  • Index Cond: (change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
17. 0.000 0.000 ↓ 0.0 0

Index Scan using changes_6mi_change_id_idx on changes_6mi (cost=0.43..7.63 rows=1 width=670) (never executed)

  • Index Cond: (change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
18. 0.000 0.000 ↓ 0.0 0

Index Scan using changes_7mi_change_id_idx on changes_7mi (cost=0.43..6.93 rows=1 width=575) (never executed)

  • Index Cond: (change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
Planning time : 0.635 ms