explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LOyL

Settings
# exclusive inclusive rows x rows loops node
1. 0.524 6.768 ↓ 18.0 18 1

Nested Loop (cost=980.70..988.80 rows=1 width=115) (actual time=4.608..6.768 rows=18 loops=1)

2. 0.488 6.028 ↓ 18.0 18 1

Nested Loop (cost=980.42..988.50 rows=1 width=44) (actual time=4.562..6.028 rows=18 loops=1)

3. 0.488 5.342 ↓ 18.0 18 1

Nested Loop (cost=980.14..988.18 rows=1 width=44) (actual time=4.523..5.342 rows=18 loops=1)

4. 0.335 4.638 ↓ 18.0 18 1

Sort (cost=979.86..979.86 rows=1 width=8) (actual time=4.478..4.638 rows=18 loops=1)

  • Sort Key: pa_1.id DESC
  • Sort Method: quicksort Memory: 25kB
5. 0.496 4.303 ↓ 18.0 18 1

Nested Loop (cost=899.14..979.85 rows=1 width=8) (actual time=1.108..4.303 rows=18 loops=1)

  • Join Filter: (c_2.lgr11_curriculum_id = c_1.lgr11_curriculum_id)
6. 0.657 3.609 ↓ 2.2 18 1

Nested Loop (cost=898.86..977.17 rows=8 width=24) (actual time=1.069..3.609 rows=18 loops=1)

7. 0.372 1.476 ↓ 3.6 18 1

GroupAggregate (cost=888.44..888.54 rows=5 width=24) (actual time=0.968..1.476 rows=18 loops=1)

  • Group Key: pa_2.user_id, c_2.lgr11_curriculum_id
8. 0.362 1.104 ↓ 3.8 19 1

Sort (cost=888.44..888.45 rows=5 width=24) (actual time=0.931..1.104 rows=19 loops=1)

  • Sort Key: pa_2.user_id
  • Sort Method: quicksort Memory: 26kB
9. 0.398 0.742 ↓ 3.8 19 1

Nested Loop (cost=6.55..888.38 rows=5 width=24) (actual time=0.092..0.742 rows=19 loops=1)

10. 0.056 0.056 ↑ 1.0 3 1

Index Scan using course_lgr11_curriculum_id_idx on course c_2 (cost=0.28..11.48 rows=3 width=16) (actual time=0.023..0.056 rows=3 loops=1)

  • Index Cond: (lgr11_curriculum_id = 84547)
11. 0.246 0.288 ↑ 28.5 6 3

Bitmap Heap Scan on published_assessment pa_2 (cost=6.27..290.59 rows=171 width=24) (actual time=0.031..0.096 rows=6 loops=3)

  • Recheck Cond: (course_id = c_2.id)
  • Filter: ((NOT hide) AND (published_date > '2005-01-02 00:00:00'::timestamp without time zone) AND (published_date < '2019-10-04 00:00:00'::timestamp without time zone) AND (user_id = ANY ('{27756,27757,27758,27759,27760,27761,27762,27772,27778,27780,27781,27782,27783,27784,27785,27786,27787,27788,27789,27790,27791,27792,27793,27794,27795,27796,27797,27798,27799,27800,27801,27802,27803,27804,27805,27806,27807,27808,27809,27811,27812,27813,27814,27815,27816,27817,27818,27819,27820,27821,27822,27823,27824,27825,27826,27827,27828,27829,27830,27831,27832,27833,27834,27835,27836,27837,27838,27839,27840,27842,27843,27844,27845,27846,27847,27848,27849,27850,27851,27852,27853,27854,27855,27856,27857,27858,27859,27860,27861,27862,27863,27864,27865,27866,27867,27868,27869,27870,27871,27873,27874,27875,27876,27877,27878,27879,27880,27881,27882,27883,27884,27885,27886,27887,27888,27889,27890,27891,27892,27893,27894,27895,27896,27897,27898,27899,27900,27901,27902,27904,27905,27906,27907,27908,27909,27910,27911,27912,27913,27914,27915,27916,27917,27918,27919,27920,27921,27922,27923,27924,27925,27926,27927,27928,27929,27930,27931,27932,27933,27935,27936,27937,27938,27939,27940,27941,27942,27943,27944,27945,27946,27947,27948,27949,27950,27951,27952,27953,27954,27955,27956,27957,27958,27959,27960,27961,27962,27963,27964,84285,27966,27967,27968,84289,27969,27970,27971,27972,84293,27973,27974,27975,27976,84297,27977,27978,27979,27980,84301,27981,27982,27983,27984,84305,27985,27986,27987,27988,84309,27989,27990,27991,27992,84313,27993,27994,27995,84317,27997,27998,27999,28000,84321,28001,28002,28003,28004,28005,28006,28007,28008,28009,28010,84331,28011,28012,28013,28014,84335,28015,28016,28017,28018,84339,28019,28020,28021,28022,84343,28023,28024,28025,28026,84347,28028,28029,28030,84351,28031,28032,28033,28034,84355,28035,28036,28037,28038,84359,28039,28040,28041,28042,84363,28043,28044,28045,28046,28047,28048,28049,28050,28051,28052,84373,28053,28054,28055,28056,84377,28057,28059,28060,84381,28061,28062,28063,28064,28065,28066,28067,28068,28069,28070,28071,28072,28073,28074,28075,28076,28077,28078,28079,28080,28081,28082,28083,28084,28085,28086,28087,28088,28090,28091,28092,28093,28094,28095,28096,28097,28098,28099,28100,28101,28102,28103,28104,28105,28106,28107,28108,28109,28110,28111,28112,28113,28114,28115,28116,28117,28118,28119,28121,28122,28123,28124,28125,28126,28127,28128,28129,28130,28131,28132,28133,28134,28135,28136,28137,28138,28139,28140,28141,28142,28143,28144,28145,28146,28147,28148,28149,28150,28152,28153,28154,28155,28156,28157,28158,28159,28160,28161,28162,28163,28164,28165,28166,28167,28168,28169,28170,28171,28172,28173,28174,28175,28176,28177,28178,28179,28180,28181,28183,28184,28185,28186,28187,28188,28189,28190,28191,28192,28193,28194,28195,28196,28197,28198,28199,28200,28201,28202,28203,28204,28205,28206,28207,28208,28209,28210,28211,28212,28215,28216,28217,28218,28219,28220,28221,28222,28223,28224,28225,28226,28227,28228,28229,28230,28231,28232,28233,28234,28235,28236,28237,28238,28239,28240,28241,28242,28243,28245,28246,28247,28248,28249,28250,28251,28252,28253,28254,28255,28256,28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28267,28268,28269,28270,28271,28272,28273,28274,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28286,28287,28288,28289,28290,28291,28292,28293,28294,28295,28296,28297,28298,28299,28300,28301,28302,28303,28304,28305,28307,28308,28309,28310,28311,28312,28313,28314,28315,28316,28317,28318,28319,28320,28321,28322,28323,28324,28325,28326,28327,28328,28329,28330,28331,28332,28333,28334,28335,28336}'::bigint[])))
  • Heap Blocks: exact=2
12. 0.042 0.042 ↑ 43.2 6 3

Bitmap Index Scan on published_assessment_course_id_idx (cost=0.00..6.22 rows=259 width=0) (actual time=0.011..0.014 rows=6 loops=3)

  • Index Cond: (course_id = c_2.id)
13. 0.504 1.476 ↑ 2.0 1 18

Bitmap Heap Scan on published_assessment pa_1 (cost=10.42..17.70 rows=2 width=32) (actual time=0.073..0.082 rows=1 loops=18)

  • Recheck Cond: ((user_id = pa_2.user_id) AND (published_date = (max(pa_2.published_date))))
  • Heap Blocks: exact=18
14. 0.576 0.972 ↓ 0.0 0 18

BitmapAnd (cost=10.42..10.42 rows=2 width=0) (actual time=0.054..0.054 rows=0 loops=18)

15. 0.198 0.198 ↑ 42.0 2 18

Bitmap Index Scan on published_assessment_user_idx (cost=0.00..4.91 rows=84 width=0) (actual time=0.011..0.011 rows=2 loops=18)

  • Index Cond: (user_id = pa_2.user_id)
16. 0.198 0.198 ↑ 130.0 1 18

Bitmap Index Scan on published_assessment_pdate_idx (cost=0.00..5.26 rows=130 width=0) (actual time=0.010..0.011 rows=1 loops=18)

  • Index Cond: (published_date = (max(pa_2.published_date)))
17. 0.198 0.198 ↑ 1.0 1 18

Index Scan using course_pkey on course c_1 (cost=0.28..0.32 rows=1 width=16) (actual time=0.011..0.011 rows=1 loops=18)

  • Index Cond: (id = pa_1.course_id)
18. 0.216 0.216 ↑ 1.0 1 18

Index Scan using published_assessment_pkey on published_assessment pa (cost=0.28..8.30 rows=1 width=52) (actual time=0.011..0.012 rows=1 loops=18)

  • Index Cond: (id = pa_1.id)
19. 0.198 0.198 ↑ 1.0 1 18

Index Scan using course_pkey on course c (cost=0.28..0.32 rows=1 width=16) (actual time=0.011..0.011 rows=1 loops=18)

  • Index Cond: (id = pa.course_id)
20. 0.216 0.216 ↑ 1.0 1 18

Index Scan using users_pkey on users u (cost=0.28..0.30 rows=1 width=47) (actual time=0.012..0.012 rows=1 loops=18)

  • Index Cond: (id = pa.user_id)
  • Filter: (NOT test_person)
Planning time : 3.461 ms
Execution time : 7.439 ms