explain.depesz.com

PostgreSQL's explain analyze made readable

Result: f2Eh

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 76,917.592 ↑ 2,094,104.6 14 1

Gather Merge (cost=17,885,238.77..21,305,848.39 rows=29,317,464 width=664) (actual time=76,915.282..76,917.592 rows=14 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 0.129 230,725.680 ↑ 2,931,746.4 5 3

Sort (cost=17,884,238.75..17,920,885.58 rows=14,658,732 width=664) (actual time=76,908.559..76,908.560 rows=5 loops=3)

  • Sort Key: changes_6mi.change_id
  • Sort Method: quicksort Memory: 29kB
  • Worker 0: Sort Method: quicksort Memory: 26kB
  • Worker 1: Sort Method: quicksort Memory: 26kB
3. 5,737.998 230,725.551 ↑ 2,931,746.4 5 3

Hash Join (cost=1,928.14..3,212,861.83 rows=14,658,732 width=664) (actual time=55,142.788..76,908.517 rows=5 loops=3)

  • Hash Cond: (changes_6mi.change_id = (unnest(patients_consultation_logs_y2018.change_ids)))
4. 4,552.860 224,985.504 ↑ 1.2 23,453,971 3

Parallel Append (cost=0.00..2,970,896.96 rows=29,317,463 width=663) (actual time=1.941..74,995.168 rows=23,453,971 loops=3)

5. 31,066.785 31,066.785 ↓ 2.4 9,994,697 1

Parallel Seq Scan on changes_6mi (cost=0.00..404,653.57 rows=4,164,457 width=670) (actual time=5.793..31,066.785 rows=9,994,697 loops=1)

6. 30,994.674 30,994.674 ↓ 2.4 9,560,606 1

Parallel Seq Scan on changes_0ml (cost=0.00..400,276.86 rows=3,983,586 width=674) (actual time=0.021..30,994.674 rows=9,560,606 loops=1)

7. 32,125.323 32,125.323 ↓ 2.4 9,979,433 1

Parallel Seq Scan on changes_2mi (cost=0.00..399,056.97 rows=4,158,097 width=664) (actual time=0.011..32,125.323 rows=9,979,433 loops=1)

8. 32,094.597 32,094.597 ↓ 2.4 9,903,022 1

Parallel Seq Scan on changes_1mi (cost=0.00..398,920.59 rows=4,126,259 width=663) (actual time=0.009..32,094.597 rows=9,903,022 loops=1)

9. 31,204.569 31,204.569 ↑ 1.2 3,332,712 3

Parallel Seq Scan on changes_4mi (cost=0.00..397,861.90 rows=4,165,890 width=663) (actual time=0.935..10,401.523 rows=3,332,712 loops=3)

10. 31,739.920 31,739.920 ↓ 2.4 9,959,125 1

Parallel Seq Scan on changes_3mi (cost=0.00..394,655.35 rows=4,149,635 width=661) (actual time=2.259..31,739.920 rows=9,959,125 loops=1)

11. 30,992.537 30,992.537 ↓ 2.4 9,775,974 1

Parallel Seq Scan on changes_5mi (cost=0.00..393,822.22 rows=4,073,322 width=660) (actual time=0.002..30,992.537 rows=9,775,974 loops=1)

12. 214.239 214.239 ↓ 2.4 1,190,920 1

Parallel Seq Scan on changes_7mi (cost=0.00..35,062.17 rows=496,217 width=575) (actual time=0.008..214.239 rows=1,190,920 loops=1)

13. 0.021 2.049 ↑ 14.3 14 3

Hash (cost=1,925.64..1,925.64 rows=200 width=8) (actual time=0.683..0.683 rows=14 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.036 2.028 ↑ 14.3 14 3

HashAggregate (cost=1,923.64..1,925.64 rows=200 width=8) (actual time=0.672..0.676 rows=14 loops=3)

  • Group Key: (unnest(patients_consultation_logs_y2018.change_ids))
15. 0.003 1.992 ↑ 1,600.0 14 3

Append (cost=0.43..1,643.64 rows=22,400 width=8) (actual time=0.629..0.664 rows=14 loops=3)

16. 0.003 0.825 ↓ 0.0 0 3

ProjectSet (cost=0.43..686.70 rows=10,100 width=8) (actual time=0.275..0.275 rows=0 loops=3)

17. 0.822 0.822 ↓ 0.0 0 3

Index Scan using patients_consultation_logs_y201_consultation_id_change_date_key on patients_consultation_logs_y2018 (cost=0.43..635.45 rows=101 width=39) (actual time=0.274..0.274 rows=0 loops=3)

  • 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[])) AND (change_date > '2018-01-01'::date))
18. 0.024 1.164 ↑ 878.6 14 3

ProjectSet (cost=0.43..844.94 rows=12,300 width=8) (actual time=0.354..0.388 rows=14 loops=3)

19. 1.140 1.140 ↑ 41.0 3 3

Index Scan using patients_consultation_logs_y20_consultation_id_change_date_key1 on patients_consultation_logs_y2019 (cost=0.43..782.52 rows=123 width=39) (actual time=0.350..0.380 rows=3 loops=3)

  • 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[])) AND (change_date > '2018-01-01'::date))
Planning time : 0.489 ms